Last active
January 12, 2016 11:28
-
-
Save tibra/bc5c533b74cc91b3e552 to your computer and use it in GitHub Desktop.
Psql Scope
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
scope :in_month, -> (month, year) { where("(extract(month from start_time) = ?) AND (extract(year from start_time) = ?)", month, year) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment