aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/notification.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ensure suppressor runs before validationseileencodes2016-02-241-0/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Add `ActiveRecord::Base.suppress`Michael Ryan2015-02-181-0/+2