Permalink
Browse files

A lock is unnecessary before destruction and can cause deadlocks

References:
#122
#201
  • Loading branch information...
brendon committed Jul 6, 2017
1 parent 4457318 commit 74ade7823ba5fe4ac6750e85d796ab13d0ce4eb1
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/acts_as_list/active_record/acts/callback_definer.rb
@@ -3,7 +3,7 @@ def self.call(caller_class, add_new_at)
caller_class.class_eval do
before_validation :check_top_position, unless: :act_as_list_no_update?
before_destroy :lock!, unless: Proc.new { destroyed_via_scope? || act_as_list_no_update? }
before_destroy :reload, unless: Proc.new { new_record? || destroyed_via_scope? || act_as_list_no_update? }
after_destroy :decrement_positions_on_lower_items, unless: Proc.new { destroyed_via_scope? || act_as_list_no_update? }
before_update :check_scope, unless: :act_as_list_no_update?

0 comments on commit 74ade78

Please sign in to comment.