Skip to content

Instantly share code, notes, and snippets.

@davejachimiak
Created June 27, 2012 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davejachimiak/3004311 to your computer and use it in GitHub Desktop.
Save davejachimiak/3004311 to your computer and use it in GitHub Desktop.
Cohabitant notifications
@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