aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations/associated.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #4490 from EmmanuelOga/master"José Valim2013-06-041-1/+1
| | | | | | | | This behaviour doesn't actually make sense, the context of the child should not be affected by the parent. See #10492. This reverts commit 5f8274efe128ffeec8fa3179460f5167a078f007, reversing changes made to 81e837e810460d066a2e5fc5a795366ec8ab2313.
* documentation fixes for Array.wrap and AR::Validations::AssociatedValidatorHrvoje Šimić2013-04-171-2/+2
|
* update AR::Validations documentation [ci skip]Francesco Rodriguez2012-09-221-1/+1
|
* update AR::Validations::AssociatedValidator documentation [ci skip]Francesco Rodriguez2012-07-291-13/+19
|
* validate related records in the same validation context as parent.Emmanuel Oga2012-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | 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. ```
* Do not validate associated records marked for destructionOlek Janiszewski2011-12-051-2/+3
| | | | | | The main reason for this change is to fix a bug where `validates_associated` would prevent `accepts_nested_attributes_for` with `allow_destroy: true` from destroying invalid associated records.
* make the warning clear about the effect of using validates_associated on ↵Vijay Dev2011-08-041-9/+1
| | | | both sides on an association.
* Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-2/+2
|
* copy-edits 8d96b89Xavier Noria2011-02-211-1/+3
|
* Clarification of ActiveRecord ActiveModel validation documentationPeer Allan2011-02-181-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-3/+4
|
* Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options ↵Jeroen van Dijk2010-06-211-1/+1
| | | | | | | | | | | | | | | | hash and make various Validators pass their (filtered) options. This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format". Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation. Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options). Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now. The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet. Signed-off-by: José Valim <jose.valim@gmail.com>
* Ensure new validates works with uniqueness validator.José Valim2010-01-081-2/+1
|
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-231-1/+1
| | | | Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
* ActiveRecord::Validations are now built on top of Validator as well.José Valim2009-12-231-7/+9
|
* Move validate_on_create and validate_on_update from ActiveModel to ActiveRecordPratik Naik2009-03-211-2/+1
|
* Move uniqueness and association validations to Active RecordPratik Naik2009-03-191-0/+47