[Solved] Ruby on Rails having more than 1 different column foreign keyed to same table


class User
  belongs_to :lives, class_name: 'Loca', foreign_key: 'lives_location'
  belongs_to :works, class_name: 'Loca', foreign_key: 'works_location'

  ...
end

class Loca
  has_many :users

  ...
end

1

solved Ruby on Rails having more than 1 different column foreign keyed to same table