Last active
August 31, 2015 11:59
-
-
Save damaon/8829f8090d6de1564629 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class BirthdayGenerator | |
def soon_to_be_celebrants | |
User.ordered_by_soonest_birthday | |
.where( birthday_month: 4.times.map{ |i| i.months.from_now.month } ) | |
.where.not("birthday_month = :month AND birthday_day < :day", { month: Date.today.month, day: Date.today.day } ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment