app/models/message.rb
def mark_deleted(user)
    self.sender_deleted = true if self.sender == user
    self.recipient_deleted = true if self.recipient == user
    self.sender_deleted && self.recipient_deleted ? self.destroy : save!
  end
# Marks a message as deleted by either the sender or the recipient, which ever the user that was passed is.
# Once both have marked it deleted, it is destroyed.
Marks a message as deleted by either the sender or the recipient, which ever the user that was passed is.
Once both have marked it deleted, it is destroyed.
Marks a message as deleted by either the sender or the recipient which ever the user that was passed is . Once both have marked it deleted it is destroyed .
def mark_deleted(user)
    self.sender_deleted = true if self.sender == user
    self.recipient_deleted = true if self.recipient == user
    self.sender_deleted && self.recipient_deleted ? self.destroy : save!
  end
def mark_deleted ( user ) self . sender_deleted = true if self . sender == user self . recipient_deleted = true if self . recipient == user self . sender_deleted && self . recipient_deleted ? self . destroy : save! end
Marks a message as deleted by either the sender or the recipient, which ever the user that was passed is.
Marks a message as deleted by either the sender or the recipient which ever the user that was passed is .
user