From d433436271c5270021648a44fcf7467843d9a25f Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 15 May 2013 09:18:08 -0700 Subject: use unless instead of if! --- activesupport/lib/active_support/callbacks.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/callbacks.rb') diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index c4cfc11372..1ba6d85b95 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -146,7 +146,7 @@ module ActiveSupport value = env.value halted = env.halted - if !halted + unless halted result = user_callback.call target, value env.halted = halted_lambda.call(target, result) if env.halted @@ -217,7 +217,7 @@ module ActiveSupport def self.halting(next_callback, user_callback) lambda { |env| env = next_callback.call env - if !env.halted + unless env.halted user_callback.call env.target, env.value end env @@ -284,7 +284,7 @@ module ActiveSupport target = env.target value = env.value - if !env.halted + unless env.halted user_callback.call(target, value) { env = next_callback.call env env.value -- cgit v1.2.3