The code powering m.abunchtell.com https://m.abunchtell.com
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

26 righe
547 B

  1. class Follow < ApplicationRecord
  2. include Streamable
  3. belongs_to :account
  4. belongs_to :target_account, class_name: 'Account'
  5. validates :account, :target_account, presence: true
  6. validates :account_id, uniqueness: { scope: :target_account_id }
  7. def verb
  8. destroyed? ? :unfollow : :follow
  9. end
  10. def target
  11. target_account
  12. end
  13. def object_type
  14. :person
  15. end
  16. def title
  17. destroyed? ? "#{account.acct} is no longer following #{target_account.acct}" : "#{account.acct} started following #{target_account.acct}"
  18. end
  19. end