aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/suppressor.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Keep state around for nested calls to #suppressJahfer Husain2016-05-161-1/+2
| | | | | | | | | If a call to #suppress from the same class occurred inside another #suppress block, the suppression state would be set to false before the outer block completes. This change keeps the previous state around in memory and unwinds it as the blocks exit.
* 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