Files
ocelots/app/models/message.rb
T

13 lines
318 B
Ruby

class Message < ActiveRecord::Base
attr_accessible :team, :person, :content
belongs_to :person
belongs_to :team
def api_attributes
att = attributes.except *%w{person_id team_id created_at updated_at}
att[:timestamp] = created_at.to_i
att[:person] = person.minimal_api_attributes
att
end
end