aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/suppressor_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|
* 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
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-12/+12
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Keep state around for nested calls to #suppressJahfer Husain2016-05-161-0/+12
| | | | | | | | | 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/+12
| | | | | | | | | | | | | | | | | | | | 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-1/+32
| | | | | | | 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.
* Copy edit the suppressor documentationRafael Mendonça França2015-02-191-1/+0
| | | | [ci skip]
* Add `ActiveRecord::Base.suppress`Michael Ryan2015-02-181-0/+22