Skip to content

Instantly share code, notes, and snippets.

@buddhamagnet
Created May 23, 2012 10:05
Show Gist options
  • Save buddhamagnet/2774376 to your computer and use it in GitHub Desktop.
Save buddhamagnet/2774376 to your computer and use it in GitHub Desktop.
UNBOUND: CLEANER
def notify_subscriber_if_status_changed
if status_changed? && %w[success printed fail].include?(status)
status_message = status_notification
send_notifications(status_message)
end
end
def send_notifications(status_message)
target_market = (Rails.env.development?) ? User.testers.subscribed_to(self.id) : subscribers
target_market.each do |target|
ProjectMailer.delay.status_alert(self, target, status_message)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment