diff options
author | eileencodes <eileencodes@gmail.com> | 2014-05-12 19:23:04 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2014-05-12 19:29:14 -0400 |
commit | dce2385095615274a6971a773ba1957aa8202e10 (patch) | |
tree | c36e39e227c005fdc1270ebc300f43ad8189d4ed | |
parent | 3ccd24a33f3f9d6cad83181708e5aa11588b88b0 (diff) | |
download | rails-dce2385095615274a6971a773ba1957aa8202e10.tar.gz rails-dce2385095615274a6971a773ba1957aa8202e10.tar.bz2 rails-dce2385095615274a6971a773ba1957aa8202e10.zip |
flip conditional to use if/else instead of unless/else
Use if/else instead of unless/else so conditional reads better.
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 6 |
1 files 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 |