From dce2385095615274a6971a773ba1957aa8202e10 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Mon, 12 May 2014 19:23:04 -0400 Subject: flip conditional to use if/else instead of unless/else Use if/else instead of unless/else so conditional reads better. --- activesupport/lib/active_support/callbacks.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 05ca943776..0a99cbd004 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -297,14 +297,14 @@ module ActiveSupport target = env.target value = env.value - unless env.halted + if env.halted + next_callback.call env + else user_callback.call(target, value) { env = next_callback.call env env.value } env - else - next_callback.call env end } end -- cgit v1.2.3