Skip to content

Instantly share code, notes, and snippets.

@madsheep madsheep/membership.rb
Last active Aug 29, 2015

What would you like to do?
Still simple
class Membership
belongs_to :user
belongs_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
NotificationMailer.accepted(self, user).deliver!
NotificationMailer.accepted_admin(self, group.admin).deliver!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.