Just so I’m clear we have:
class Parent
has_many :children
has_many :grandchildren, through: :children
end
class Child
belongs_to :parent
has_many :grandchildren
end
class Grandchild
belongs_to :child
has_one :parent, through: :child
end
So when you save a grandchild
are you checking the parent
is valid? or is present?
I only ask because I wouldn’t expect to find a grandchild_id or parent_id on either end of a has_many :through
.