follow_recommendation.rb 584 B

12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: global_follow_recommendations
  5. #
  6. # account_id :bigint(8) primary key
  7. # rank :decimal(, )
  8. # reason :text is an Array
  9. #
  10. class FollowRecommendation < ApplicationRecord
  11. include DatabaseViewRecord
  12. self.primary_key = :account_id
  13. self.table_name = :global_follow_recommendations
  14. belongs_to :account_summary, foreign_key: :account_id, inverse_of: false
  15. belongs_to :account
  16. scope :localized, ->(locale) { joins(:account_summary).merge(AccountSummary.localized(locale)) }
  17. end