diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-06 12:18:24 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-06 12:18:24 -0800 |
commit | f7d509882ef1d5a54cb2b15e871cd70e4af3c5ed (patch) | |
tree | e4d1c4019694bf10e989b988bdd7389bebaf0cd7 /activeresource/test | |
parent | 95dfcc4f3c4bda74efe220e6dd5a11f58f29a501 (diff) | |
download | rails-f7d509882ef1d5a54cb2b15e871cd70e4af3c5ed.tar.gz rails-f7d509882ef1d5a54cb2b15e871cd70e4af3c5ed.tar.bz2 rails-f7d509882ef1d5a54cb2b15e871cd70e4af3c5ed.zip |
Prefer tap to returning
Diffstat (limited to 'activeresource/test')
-rw-r--r-- | activeresource/test/setter_trap.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activeresource/test/setter_trap.rb b/activeresource/test/setter_trap.rb index 9a899b0fa0..7cfd9ca111 100644 --- a/activeresource/test/setter_trap.rb +++ b/activeresource/test/setter_trap.rb @@ -1,9 +1,8 @@ class SetterTrap < ActiveSupport::BasicObject class << self def rollback_sets(obj) - returning yield(setter_trap = new(obj)) do - setter_trap.rollback_sets - end + trapped = new(obj) + yield(trapped).tap { trapped.rollback_sets } end end |