mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
9b15e01c21
E.G.: ```ruby class Parent < ActiveRecord::Base has_one :child validates_presence_of :name, :on => "custom_context" validates_associated :child end class Child < ActiveRecord::Base belongs_to :parent validates_presence_of :name, :on => "custom_context" end p = Parent.new(:name => "Montoto", :child => Child.new) p.valid?(:custom_context) # => Returns true, even though the child is not valid under the same context. ``` |
||
---|---|---|
.. | ||
association_validation_test.rb | ||
i18n_generate_message_validation_test.rb | ||
i18n_validation_test.rb | ||
uniqueness_validation_test.rb |