Hi!
I don't know if this is a bur or not, but I have the following models:
class Client < ActiveRecord::Base
acts_as_superclass
belongs_to :company
...
end
class Provider < ActiveRecord::Base
acts_as :client
...
end
class Company < ActiveRecord::Base
has_many :clients
has_many :providers, through: :clients
...
end
If I try to get the providers of a Company, I get the following error:
ctiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :provider or :providers in model Client. Try 'has_many :providers, :through => :clients, :source => <name>'. Is it one of :as_client, :contact_people, :addresses, or :company?
Is it a bug or am I creating the relation in a wrong way?
Thanks in advance!
Hi! I don't know if this is a bur or not, but I have the following models:
If I try to get the providers of a Company, I get the following error:
Is it a bug or am I creating the relation in a wrong way? Thanks in advance!