Getting Following Error ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection in ProjectController#create
Cannot modify association 'ProjectMaster#tag_masters' because the source reflection class 'TagMaster' is associated to 'ProjectTag' via :has_many.
Following are my models.
class ProjectTag < ActiveRecord::Base
has_many :tag_masters
has_many :project_masters
end
class TagMaster < ActiveRecord::Base
has_many :project_tags
has_many :project_masters, :through => :project_tags
end
class ProjectMaster < ActiveRecord::Base
has_many :project_tags
has_many :tag_masters, :through => :project_tags
# Some more code and associations here..
end
I am new to rails and tried to solve it but I don't think i can change my associations.
I am using rails 3.0.10
Please help me out here.
- Thanks
has_many :tag_masters
has_many :project_masters
end instead of has_many; I had to use belongs_to. – Kashyap Dec 13 '11 at 12:44