Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created October 25, 2011 08:34
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 ahawkins/1311859 to your computer and use it in GitHub Desktop.
Save ahawkins/1311859 to your computer and use it in GitHub Desktop.
def notify_of_deal_state_change
return unless state_changed?
Deal.changed
case state
when 'closed'
Deal.notify_observers 'deal_closed', self
when 'rejected'
Deal.notify_observers 'deal_rejected', self
when 'pending'
Deal.notify_observers 'deal_reopened', self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment