Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From Rails changeset 5876: http://dev.rubyonrails.org/changeset/5876
A range may be used in the hash to use the SQL BETWEEN operator:
Student.find(:all, :conditions => { :grade => 9..12 })
... so, presumably ...
User.find(:all, :conditions => { :created_at => '2009-01-01'..'2009-02-01' })
... compare with ...
User.find(:all, :conditions => { :created_at.month = 1, :created_at.year = 2009 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment