From 8ee6b51627d7257146b8bafe26dc0a109a62ba13 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Tue, 11 Jan 2011 06:55:07 +1100 Subject: [PATCH] Remove unecessary refresh in Sequel make Sequel will handle this automatically. --- lib/machinist/sequel.rb | 1 - spec/sequel_spec.rb | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/machinist/sequel.rb b/lib/machinist/sequel.rb index 48215f3..b81530c 100644 --- a/lib/machinist/sequel.rb +++ b/lib/machinist/sequel.rb @@ -37,7 +37,6 @@ def make(*args, &block) lathe = Lathe.run(Machinist::SequelAdapter, self.new, *args) unless Machinist.nerfed? lathe.object.save - lathe.object.refresh end lathe.object(&block) end diff --git a/spec/sequel_spec.rb b/spec/sequel_spec.rb index 98cdc72..3591f41 100644 --- a/spec/sequel_spec.rb +++ b/spec/sequel_spec.rb @@ -57,6 +57,12 @@ class Comment < Sequel::Model person = Person.make person.should_not be_new end + + it "should reload object after save with column default values" do + Person.blueprint { } + person = Person.make + person.admin.should == false + end it "should create and object through a many_to_one association" do Post.blueprint { }