i have the problem that my child class fields aren't validated on saving the
parent. working with parent and child is fine.
if all fields are filled correctly everything is saved as expected.
but missing fields in the child arent added to the errors.
following short sample shows what i mean:
i have the problem that my child class fields aren't validated on saving the
parent. working with parent and child is fine.
if all fields are filled correctly everything is saved as expected.
but missing fields in the child arent added to the errors.
following short sample shows what i mean:
Model
-----------------------------------------------------
class Parent < ActiveRecord::Base
has_one :children
validates_presence_of :parent_name
def init!
self.build_children
end
end
class Children < ActiveRecord::Base
belongs_to :parent
validates_presence_of children_name
end