Skip to content

Instantly share code, notes, and snippets.

@robins35
Created June 11, 2015 20:40
Show Gist options
  • Save robins35/beeeb0a2aba97389d7e5 to your computer and use it in GitHub Desktop.
Save robins35/beeeb0a2aba97389d7e5 to your computer and use it in GitHub Desktop.
def initialize options={}
options ||= {}
self.bcc = options[:bcc] || ""
self.body = options[:body]
self.cc = options[:cc] || ""
self.link_to_timeline = options[:link_to_timeline] || true
self.listing = options[:listing]
self.listing_id = options[:listing_id]
self.message = options[:message]
self.recipient = options[:recipient]
self.recipient_id = options[:recipient_id]
self.sender = options[:sender]
self.sender_id = options[:sender_id]
self.subject = options[:subject]
self.listing ||= Listing.find_by_id listing_id
self.recipient ||= Person.find_by_id recipient_id
self.sender ||= Person.find_by_id sender_id
self.send_me_a_copy = if options[:send_me_a_copy].present?
checked?(options[:send_me_a_copy])
else
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment