What is the problem with this association?
My association looks like this:
class Quote < ApplicationRecord
has_many :language_pairs
end
class LanguagePair < ApplicationRecord
belongs_to :quote
belongs_to :w_flow
has_many :w_flow_steps, through: :w_flow
end
class WFlow < ApplicationRecord
has_many :language_pairs
has_many :w_flow_steps
end
class WFlowStep < ApplicationRecord
belongs_to :w_flow
end
When i run
q=Quote.find(1)
q.language_pairs.create!(source_language:'French - EU', w_flow_id: 1)
I have following errors:
ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'LanguagePair#w_flow_steps' because the source reflection class 'WFlowStep' is associated to 'WFlow' via :has_many.
language_pairs
associated with theQuote
with theid
= 1? – Alejandro Montilla