Skip to content
This repository

Use Object#tap instead of deprecated Object#returning #19

Open
wants to merge 1 commit into from

1 participant

Stephane Bellity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 09, 2011
Stephane Bellity Use Object#tap instead of deprecated Object#returning 05af423
This page is out of date. Refresh to see the latest.
2  lib/machinist/mongo_mapper.rb
@@ -57,7 +57,7 @@ def make(*args, &block)
57 57
       end
58 58
 
59 59
       def make_unsaved(*args)
60  
-        returning(Machinist.with_save_nerfed { make(*args) }) do |object|
  60
+        Machinist.with_save_nerfed { make(*args) }.tap do |object|
61 61
           yield object if block_given?
62 62
         end
63 63
       end
2  lib/machinist/mongoid.rb
@@ -58,7 +58,7 @@ def make(*args, &block)
58 58
       end
59 59
       
60 60
       def make_unsaved(*args)
61  
-        returning(Machinist.with_save_nerfed { make(*args) }) do |object|
  61
+        Machinist.with_save_nerfed { make(*args) }.tap do |object|
62 62
           yield object if block_given?
63 63
         end
64 64
       end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.