This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/models/status.rb
2016-02-22 18:10:30 +01:00

26 lines
361 B
Ruby

class Status < ActiveRecord::Base
belongs_to :account, inverse_of: :statuses
validates :account, presence: true
def verb
:post
end
def object_type
:note
end
def content
self.text
end
def title
content.truncate(80, omission: "...")
end
after_create do
self.account.stream_entries.create!(activity: self)
end
end