Created
June 27, 2012 14:14
-
-
Save davejachimiak/3004311 to your computer and use it in GitHub Desktop.
Cohabitant notifications
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
@cohabitant = Cohabitant.find(2) | |
@cohabitant.notification_ids | |
# => [11, 13, 14] | |
@cohabitant.notifications.each do |n| | |
puts n.created_at.strftime("%A, %B %e, %Y") + " by #{n.user.name}" | |
end | |
# => Tuesday, June 26, 2012 by New Guy | |
# => Thursday, June 28, 2012 by Old Lady | |
# => Friday, June 29, 2012 by Fun Kid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment