Sha256: f4a0edc6a9ccdea69a32fe10fb5dd14bdc01c8ddc035a7ba461dc47b38b6b41c

Contents?: true

Size: 617 Bytes

Versions: 9

Compression:

Stored size: 617 Bytes

Contents

require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper")

describe "Sequel::Plugins::SplitValues" do
  it "should skip the refresh after saving a new object" do
    c = Class.new(Sequel::Model(:a))
    c.columns :id, :x
    c.plugin :split_values
    c.dataset._fetch = {:id=>1, :x=>2, :y=>3}
    o = c.first
    c.db.reset

    o.should == c.load(:id=>1, :x=>2)
    o[:id].should == 1
    o[:x].should == 2
    o[:y].should == 3
    {c.load(:id=>1, :x=>2)=>4}[o].should == 4
    o.values.should == {:id=>1, :x=>2}

    o.save
    c.db.sqls.should == ["UPDATE a SET x = 2 WHERE (id = 1)"]
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sequel-4.22.0 spec/extensions/split_values_spec.rb
sequel-4.21.0 spec/extensions/split_values_spec.rb
sequel-4.20.0 spec/extensions/split_values_spec.rb
sequel-4.19.0 spec/extensions/split_values_spec.rb
sequel-4.18.0 spec/extensions/split_values_spec.rb
sequel-4.17.0 spec/extensions/split_values_spec.rb
sequel-4.16.0 spec/extensions/split_values_spec.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/split_values_spec.rb
sequel-4.15.0 spec/extensions/split_values_spec.rb