Permalink
Browse files

Use Proc.new instead of String based callback conditional

  • Loading branch information...
brendon committed Mar 16, 2017
1 parent c894e24 commit b2818823b4fcca2dd2e2913c357c1078a6477e80
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/acts_as_list/active_record/acts/callback_definer.rb
@@ -3,8 +3,8 @@ 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: "destroyed_via_scope? || act_as_list_no_update?"
after_destroy :decrement_positions_on_lower_items, unless: "destroyed_via_scope? || act_as_list_no_update?"
before_destroy :lock!, unless: Proc.new { 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?
after_update :update_positions, unless: :act_as_list_no_update?

0 comments on commit b281882

Please sign in to comment.