app/models/message.rb
# Put the message in the trash for the given person.
Put the message in the trash for the given person.
Put the message in the trash for the given person .
def trash(user, time=Time.now)
    case user
    when sender
      self.sender_deleted_at = time
    when recipient
      self.recipient_deleted_at = time
    else
      raise ArgumentError,  "使用者未獲得授權"
    end
    save!
  end
def trash ( user , time = Time . now ) case user when sender self . sender_deleted_at = time when recipient self . recipient_deleted_at = time else raise ArgumentError , "使用者未獲得授權" end save! end
Put the message in the trash for the given person.
Put the message in the trash for the given person .
# Given our controller before filters, this should never happen...
user
<not_specific>
time
<not_specific>
now
<not_specific>