diff options
author | Carol Nichols <carol.nichols@gmail.com> | 2014-12-07 22:13:17 -0500 |
---|---|---|
committer | Carol Nichols <carol.nichols@gmail.com> | 2014-12-07 22:16:00 -0500 |
commit | ffce60e1280a4a1262f66660cd1540f424848157 (patch) | |
tree | 9c89879d0c1ddc0d9085d7e707126181e4907c2b /activerecord/lib | |
parent | 9eb4869f80107be19b6d161a7f2e05449afee85a (diff) | |
download | rails-ffce60e1280a4a1262f66660cd1540f424848157.tar.gz rails-ffce60e1280a4a1262f66660cd1540f424848157.tar.bz2 rails-ffce60e1280a4a1262f66660cd1540f424848157.zip |
Make error message clearer that :on requires a symbol, not a string
The validation added in 5a3dc8092d19c816b0b1203945639cb91d065847 will
reject values for the `:on` option for after_commit and after_rollback
callbacks that are string values like `"create"`.
However, the error message says ":on conditions for after_commit and
after_rollback callbacks have to be one of create,destroy,update". That
looks like a string value *would* be valid.
This commit changes the error message to say ":on conditions for
after_commit and after_rollback callbacks have to be one of [:create,
:destroy, :update]", making it clearer that symbols are required.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index f92e1de03b..01e8f69b02 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -265,7 +265,7 @@ module ActiveRecord def assert_valid_transaction_action(actions) if (actions - ACTIONS).any? - raise ArgumentError, ":on conditions for after_commit and after_rollback callbacks have to be one of #{ACTIONS.join(",")}" + raise ArgumentError, ":on conditions for after_commit and after_rollback callbacks have to be one of #{ACTIONS}" end end end |