diff --git a/app/models/organization.rb b/app/models/organization.rb index 191014f..3e58da8 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -2,5 +2,9 @@ class Organization < ApplicationRecord self.table_name = 'organisations' has_many :roles, as: :access_to - has_many :users, through: :roles, source: :access_to, source_type: "Organisation" + has_many :users, through: :roles + + def self.polymorphic_name + "Organisation" + end end