Method: Discuss::Message#reply!

Defined in:
app/models/discuss/message.rb

#reply!(options = {}) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'app/models/discuss/message.rb', line 83

def reply! options={}
  if parent
    reply = children.create!(subject: options.fetch(:subject, subject),
                             body: options.fetch(:body, nil),
                             user: user,
                             recipients: [parent.user])
    reply.send!
  end
end