Skip to content

Instantly share code, notes, and snippets.

@diegoy
Created June 13, 2017 01:10
Show Gist options
  • Save diegoy/a7ebde7a2e8678c38aeaa971028ee3c0 to your computer and use it in GitHub Desktop.
Save diegoy/a7ebde7a2e8678c38aeaa971028ee3c0 to your computer and use it in GitHub Desktop.
def create
conversation = Conversation.find(params[:conversation_id])
if message = conversation.messages.create(params)
Mailer.send_message(destination, message).deliver_later
AndroidNotification.sent_message(destination, message)
AppleNotification.sent_message(destination, message)
#render success
else
#render error
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment