The include_date_scopes gem is live and ready for consumption. I ripped this out of my company’s codebase since its something that lots of people could use. My original inspiration for it was when I found myself trying to correct four different variations of the between date scope in our codebase. I moved all of our date scopes into a single file and included them wherever we needed date related scopes.
Since then it has evolved quite a bit. You can now do date scopes on columns other than `created_at` and you can prepend a name to the date scopes.
Moving this off to its own gem involved several challenges including how to setup a sample ActiveModel to use in specs and just how to setup the structure of the files and folders in a gem. I’ll detail each of these hurdles in separate posts.