The code powering m.abunchtell.com https://m.abunchtell.com
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
579 B

  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: list_accounts
  5. #
  6. # id :integer not null, primary key
  7. # list_id :integer not null
  8. # account_id :integer not null
  9. # follow_id :integer not null
  10. #
  11. class ListAccount < ApplicationRecord
  12. belongs_to :list, required: true
  13. belongs_to :account, required: true
  14. belongs_to :follow, required: true
  15. before_validation :set_follow
  16. private
  17. def set_follow
  18. self.follow = Follow.find_by(account_id: list.account_id, target_account_id: account.id)
  19. end
  20. end