Skip to content

Commit

Permalink
A lock is unnecessary before destruction and can cause deadlocks
Browse files Browse the repository at this point in the history
References:
#122
#201
  • Loading branch information
brendon committed Jul 6, 2017
1 parent 4457318 commit 74ade78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_list/active_record/acts/callback_definer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 74ade78

Please sign in to comment.