Skip to content
This repository

1.0 maintenance #72

Open
wants to merge 2 commits into from

1 participant

Nathan Sobo
Nathan Sobo

When I attempted to use the Sequel adaptor on Ruby 1.9.2 and Rails 3, I got some deprecation warnings about the use of returning in this one spot. I switched it to Object#tap, which I believe has been back-ported to 1.8.7. Is machinist 2 ready enough for me to use it instead? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 2 deletions. Show diff stats Hide diff stats

  1. 3  lib/machinist/sequel.rb
3  lib/machinist/sequel.rb
@@ -37,13 +37,12 @@ def make(*args, &block)
37 37
         lathe = Lathe.run(Machinist::SequelAdapter, self.new, *args)
38 38
         unless Machinist.nerfed?
39 39
           lathe.object.save
40  
-          lathe.object.refresh
41 40
         end
42 41
         lathe.object(&block)
43 42
       end
44 43
 
45 44
       def make_unsaved(*args)
46  
-        returning(Machinist.with_save_nerfed { make(*args) }) do |object|
  45
+        (Machinist.with_save_nerfed { make(*args) }).tap do |object|
47 46
           yield object if block_given?
48 47
         end
49 48
       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.