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.

16 lines
430 B

  1. # frozen_string_literal: true
  2. class Follow < ApplicationRecord
  3. include Paginable
  4. belongs_to :account, counter_cache: :following_count, required: true
  5. belongs_to :target_account,
  6. class_name: 'Account',
  7. counter_cache: :followers_count,
  8. required: true
  9. has_one :notification, as: :activity, dependent: :destroy
  10. validates :account_id, uniqueness: { scope: :target_account_id }
  11. end