Skip to content

Instantly share code, notes, and snippets.

@damaon
Last active August 31, 2015 11:59
Show Gist options
  • Save damaon/8829f8090d6de1564629 to your computer and use it in GitHub Desktop.
Save damaon/8829f8090d6de1564629 to your computer and use it in GitHub Desktop.
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