diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-13 11:06:40 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-13 11:06:40 -0800 |
commit | aac032073de638d3fcad5d878ae7d42354c9cee8 (patch) | |
tree | 5bb201db68f6a8d422169e40fb6976f6264e0855 /activerecord/lib/active_record | |
parent | 5ed0381db5e6dff1269f3f22ec4fa69c203c37d9 (diff) | |
parent | 05e1466e059a12bddd066a9f22ca575d81cfc21d (diff) | |
download | rails-aac032073de638d3fcad5d878ae7d42354c9cee8.tar.gz rails-aac032073de638d3fcad5d878ae7d42354c9cee8.tar.bz2 rails-aac032073de638d3fcad5d878ae7d42354c9cee8.zip |
Merge pull request #8188 from courtland/habtm-fix-stable
Fix deleting from a HABTM join table upon destroying an object of a mode...
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 7deac2588a..b2881991d5 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -102,6 +102,8 @@ module ActiveRecord def destroy #:nodoc: return super unless locking_enabled? + destroy_associations + if persisted? table = self.class.arel_table lock_col = self.class.locking_column |