aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/suppressor.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ensure suppressor runs before validationseileencodes2016-02-241-1/+5
| | | | | | | | | | | | | | | | | | | | I ran into an issue where validations on a suppressed record were causing validation errors to be thrown on a record that was never going to be saved. There isn't a reason to run the validations on a record that doesn't matter. This change moves the suppressor up the chain to be run on the `save` or `save!` in the validations rather than in persistence. The issue with running it when we hit persistence is that the validations are run first, then we hit persistance, and then we hit the suppressor. The suppressor comes first. The change to the test was required since I added the `validates_presence_of` validations. Adding this alone was enough to demonstrate the issue. I added a new test to demonstrate the new behavior is explict.
* Apply Active Record suppression to all savesGeorge Claghorn2015-06-041-2/+1
| | | | | | | It was not being applied to creates and updates attempted through the non-bang save methods. This means that, for example, creation of records for singular associations through the `create_*` methods was not appropriately ignored in .suppress blocks.
* Return true instead of self when suppressedRafael Mendonça França2015-02-191-1/+1
| | | | | save is documented to return singletons so we should always return a singleton.
* Copy edit the suppressor documentationRafael Mendonça França2015-02-191-15/+15
| | | | [ci skip]
* Add `ActiveRecord::Base.suppress`Michael Ryan2015-02-181-0/+55