Nested form validation statements repeating multiple times
问题 Given the following associations: class Parent has_many :a_childs validates_associated :a_childs accepts_nested_attributes_for :a_childs has_many :b_childs validates_associated :b_childs accepts_nested_attributes_for :b_childs has_many :charges validates_associated :charges accepts_nested_attributes_for :charges validate :test_puts def test_puts puts "validating Parent - #{self.attribute}" end end class AChild belongs_to :parent has_many :charges validates_associated :charges accepts_nested