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.

28 lines
445 B

  1. class Favourite < ApplicationRecord
  2. include Streamable
  3. belongs_to :account, inverse_of: :favourites
  4. belongs_to :status, inverse_of: :favourites
  5. validates :status_id, uniqueness: { scope: :account_id }
  6. def verb
  7. :favorite
  8. end
  9. def title
  10. "#{account.acct} favourited a status by #{status.account.acct}"
  11. end
  12. def object_type
  13. target.object_type
  14. end
  15. def thread
  16. status
  17. end
  18. def target
  19. thread
  20. end
  21. end