Created
January 27, 2009 00:42
-
-
Save charliepark/53083 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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