app/models/message.rb
# marks a message as deleted by either the sender or the recepient, which ever the user that was passed is.
# When both sender and recepient marks it deleted, it is destroyed.
marks a message as deleted by either the sender or the recepient, which ever the user that was passed is.
When both sender and recepient marks it deleted, it is destroyed.
marks a message as deleted by either the sender or the recepient which ever the user that was passed is . When both sender and recepient marks it deleted it is destroyed .
def mark_message_deleted(id,user_id)
 self.sender_deleted = true if self.sender_id == user_id and self.id=id
 self.recepient_deleted = true if self.recepient_id == user_id and self.id=id
 self.sender_deleted && self.recepient_deleted ? self.destroy : save!
 end
def mark_message_deleted ( id , user_id ) self . sender_deleted = true if self . sender_id == user_id and self . id = id self . recepient_deleted = true if self . recepient_id == user_id and self . id = id self . sender_deleted && self . recepient_deleted ? self . destroy : save! end
marks a message as deleted by either the sender or the recepient, which ever the user that was passed is.
marks a message as deleted by either the sender or the recepient which ever the user that was passed is .
id
user_id