mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 04:02:07 +01:00
25 lines
361 B
Ruby
25 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
|