diff options
author | Christian Bäuerlein <fabrik42@gmail.com> | 2011-10-14 18:20:41 +0200 |
---|---|---|
committer | Christian Bäuerlein <fabrik42@gmail.com> | 2011-10-14 18:20:41 +0200 |
commit | c6f0461e898601578fa8160608d19fec319067fa (patch) | |
tree | 4de9603d0f57beb70d7374bf46b073e3995731d9 /activerecord/lib/active_record/locking | |
parent | 410fa4cf7c710ff062c59c1c90357729c418be65 (diff) | |
download | rails-c6f0461e898601578fa8160608d19fec319067fa.tar.gz rails-c6f0461e898601578fa8160608d19fec319067fa.tar.bz2 rails-c6f0461e898601578fa8160608d19fec319067fa.zip |
Consider attempted action in exception message of ActiveRecord::StaleObjectError
Diffstat (limited to 'activerecord/lib/active_record/locking')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index cafe48cff6..2df3309648 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -103,7 +103,7 @@ module ActiveRecord affected_rows = connection.update stmt unless affected_rows == 1 - raise ActiveRecord::StaleObjectError, self + raise ActiveRecord::StaleObjectError.new(self, "update") end affected_rows @@ -127,7 +127,7 @@ module ActiveRecord affected_rows = self.class.unscoped.where(predicate).delete_all unless affected_rows == 1 - raise ActiveRecord::StaleObjectError, self + raise ActiveRecord::StaleObjectError.new(self, "destroy") end end |