Last active
August 29, 2015 14:00
-
-
Save madsheep/3a55438c2df9e8e7593c to your computer and use it in GitHub Desktop.
Still simple
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
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! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment