diff options
author | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2015-02-19 09:04:31 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2015-02-19 09:04:31 -0200 |
commit | 41b9730c6d033ea7f38fae4d18347c5370ff7b6c (patch) | |
tree | e28e9420ff4180b9d2dc7e7f79abefc58c3ff657 /activerecord/test/models | |
parent | 06d5d2c5e9cfcd92ba239703c0d699d17a90621e (diff) | |
parent | b9a1e9a4b2289de199b214a542aa9fd3cb19be54 (diff) | |
download | rails-41b9730c6d033ea7f38fae4d18347c5370ff7b6c.tar.gz rails-41b9730c6d033ea7f38fae4d18347c5370ff7b6c.tar.bz2 rails-41b9730c6d033ea7f38fae4d18347c5370ff7b6c.zip |
Merge pull request #18910 from perceptec/add_suppressor
Add `ActiveRecord::Base.suppress` to allow save events to be suppressed within a specified block.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/notification.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/user.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/notification.rb b/activerecord/test/models/notification.rb new file mode 100644 index 0000000000..b4b4b8f1b6 --- /dev/null +++ b/activerecord/test/models/notification.rb @@ -0,0 +1,2 @@ +class Notification < ActiveRecord::Base +end diff --git a/activerecord/test/models/user.rb b/activerecord/test/models/user.rb index 23cd2e0e1c..f5dc93e994 100644 --- a/activerecord/test/models/user.rb +++ b/activerecord/test/models/user.rb @@ -2,3 +2,7 @@ class User < ActiveRecord::Base has_secure_token has_secure_token :auth_token end + +class UserWithNotification < User + after_create -> { Notification.create! message: "A new user has been created." } +end |