Skip to content

Instantly share code, notes, and snippets.

@norbajunior
Last active August 29, 2015 14:24
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 norbajunior/bf164869f82158ac2274 to your computer and use it in GitHub Desktop.
Save norbajunior/bf164869f82158ac2274 to your computer and use it in GitHub Desktop.
# app/business/concert/update.rb
# Concert::RescheduleEmail.sent(concert, new_time)
class Concert::RescheduleEmail
def self.sent(concert, new_time)
new(concert, new_time).sent
end
def initialize(concert, new_time)
@concert, @starts_at = concert, new_time.to_time
end
def sent
if concert.starts_at != new_time
ConcertMailer.reschedule(concert).deliver_now
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment