diff options
Diffstat (limited to 'activeresource/test/setter_trap.rb')
-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 |