I have two models, one of them is the parent, and the parent is accepts_nested_attributes_for and validates_associated.
However, some of my checks have: if necessary to check one of the properties of the parent.
I thought I could do something like this:
validates_presence_of :blah, :if => Proc.new{|thing| thing.parent.some_value.present?}
However, the parent relationship does not appear during validation (I would suggest that children receive an instance and are checked first.
So is there a way to do what I think? Is it possible?
source share