about summary refs log tree commit diff
path: root/app/models/status.rb
blob: c0b0ca9d9d4cb6524f7f99870fc09492d620830d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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