aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2015-06-04 00:00:20 -0400
committerGeorge Claghorn <george.claghorn@gmail.com>2015-06-04 00:11:38 -0400
commitac002395d87aa7a4bcc3126e67ca3b2808d832a6 (patch)
tree8c42d15fe11ef5d1c8e260810162fa0aff111a08 /activerecord/lib
parentae5f2b4e79f3e41aad8280109d8bfc788a1a2733 (diff)
downloadrails-ac002395d87aa7a4bcc3126e67ca3b2808d832a6.tar.gz
rails-ac002395d87aa7a4bcc3126e67ca3b2808d832a6.tar.bz2
rails-ac002395d87aa7a4bcc3126e67ca3b2808d832a6.zip
Apply Active Record suppression to all saves
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.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/suppressor.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/suppressor.rb b/activerecord/lib/active_record/suppressor.rb
index b0b86865fd..b3644bf569 100644
--- a/activerecord/lib/active_record/suppressor.rb
+++ b/activerecord/lib/active_record/suppressor.rb
@@ -37,8 +37,7 @@ module ActiveRecord
end
end
- # Ignore saving events if we're in suppression mode.
- def save!(*args) # :nodoc:
+ def create_or_update(*args) # :nodoc:
SuppressorRegistry.suppressed[self.class.name] ? true : super
end
end