Displaying 1 result from an estimated 1 matches for "second_children".
2006 Jun 12
0
validates_associated -- explicitly setting collection?
...) that has many of two other classes, say
FirstChild and SecondChild. These could look like this:
class Parent < ActiveRecord::Base
has_many :first_children, :dependent => true
has_many :first_children, :dependent => true
validates_associated :first_children
validates_associated :second_children
end
class FirstChild < ActiveRecord::Base
belongs_to :parent
validates_format_of :birth_date, :with => /^\d{4}\/\d{2}\/\d{2}$/
end
class SecondChild < ActiveRecord::Base
belongs_to :parent
validates_format_of :birth_date, :with => /^\d{4}\/\d{2}\/\d{2}$/
end
The key bit here...