You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
361 B

8 years ago
8 years ago
  1. class Status < ActiveRecord::Base
  2. belongs_to :account, inverse_of: :statuses
  3. validates :account, presence: true
  4. def verb
  5. :post
  6. end
  7. def object_type
  8. :note
  9. end
  10. def content
  11. self.text
  12. end
  13. def title
  14. content.truncate(80, omission: "...")
  15. end
  16. after_create do
  17. self.account.stream_entries.create!(activity: self)
  18. end
  19. end