Method: Mailboxer::Models::Messageable#untrash

Defined in:
lib/mailboxer/models/messageable.rb

#untrash(obj) ⇒ Object

Mark the object as not trashed for messageable.

Object can be:

  • A Receipt

  • A Message

  • A Notification

  • A Conversation

  • An array with any of them



214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/mailboxer/models/messageable.rb', line 214

def untrash(obj)
  case obj
  when Mailboxer::Receipt
    obj.untrash if obj.receiver == self
  when Mailboxer::Message, Mailboxer::Notification
    obj.untrash(self)
  when Mailboxer::Conversation
    obj.untrash(self)
  when Array
    obj.map{ |sub_obj| untrash(sub_obj) }
  end
end