sequel 5.24.0 → 5.25.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -186,4 +186,12 @@ describe "sharding plugin" do
186
186
  ["UPDATE albums SET artist_id = 2, name = 'RF' WHERE (id = 1) -- s1", "UPDATE albums SET name = 'RF', artist_id = 2 WHERE (id = 1) -- s1"].must_include(sqls.slice!(2))
187
187
  sqls.must_equal ["SELECT * FROM albums LIMIT 1 -- s2", "BEGIN -- s1", "COMMIT -- s1"]
188
188
  end
189
+
190
+ it "should have objects retrieved from a specific shard using with_server from server_block extension" do
191
+ album = @db.extension(:server_block).with_server(:s1) do
192
+ @Album.first
193
+ end
194
+ album.update(:name=>'MO')
195
+ @db.sqls.must_equal ["SELECT * FROM albums LIMIT 1 -- s1", "UPDATE albums SET name = 'MO' WHERE (id = 1) -- s1"]
196
+ end
189
197
  end
@@ -7,7 +7,7 @@ end
7
7
 
8
8
  ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
9
9
  gem 'minitest'
10
- require 'minitest/autorun'
10
+ require 'minitest/global_expectations/autorun'
11
11
  require 'minitest/hooks/default'
12
12
  require 'minitest/shared_description'
13
13
 
@@ -1,6 +1,6 @@
1
1
  ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
2
2
  gem 'minitest'
3
- require 'minitest/autorun'
3
+ require 'minitest/global_expectations/autorun'
4
4
  require 'minitest/hooks/default'
5
5
  require 'minitest/shared_description'
6
6
 
@@ -634,6 +634,15 @@ describe "Database schema modifiers" do
634
634
  @ds.all.must_equal [{:id=>10}, {:id=>20}]
635
635
  end
636
636
 
637
+ it "should set column defaults correctly if column has existing default" do
638
+ @db.create_table!(:items){Integer :id, :default=>10}
639
+ @ds.insert
640
+ @ds.all.must_equal [{:id=>10}]
641
+ @db.alter_table(:items){set_column_default :id, 20}
642
+ @ds.insert
643
+ @ds.all.must_equal [{:id=>10}, {:id=>20}]
644
+ end
645
+
637
646
  it "should set column defaults to nil correctly" do
638
647
  @db.create_table!(:items){Integer :id}
639
648
  @ds.insert(:id=>10)
@@ -7,7 +7,7 @@ Sequel::Deprecation.backtrace_filter = lambda{|line, lineno| lineno < 4 || line
7
7
 
8
8
  ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
9
9
  gem 'minitest'
10
- require 'minitest/autorun'
10
+ require 'minitest/global_expectations/autorun'
11
11
  require 'minitest/hooks/default'
12
12
 
13
13
  require_relative '../deprecation_helper'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.24.0
4
+ version: 5.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-01 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-global_expectations
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: minitest-shared_description
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -208,6 +222,7 @@ extra_rdoc_files:
208
222
  - doc/release_notes/5.22.0.txt
209
223
  - doc/release_notes/5.23.0.txt
210
224
  - doc/release_notes/5.24.0.txt
225
+ - doc/release_notes/5.25.0.txt
211
226
  files:
212
227
  - CHANGELOG
213
228
  - MIT-LICENSE
@@ -303,6 +318,7 @@ files:
303
318
  - doc/release_notes/5.22.0.txt
304
319
  - doc/release_notes/5.23.0.txt
305
320
  - doc/release_notes/5.24.0.txt
321
+ - doc/release_notes/5.25.0.txt
306
322
  - doc/release_notes/5.3.0.txt
307
323
  - doc/release_notes/5.4.0.txt
308
324
  - doc/release_notes/5.5.0.txt
@@ -490,6 +506,7 @@ files:
490
506
  - lib/sequel/plugins/active_model.rb
491
507
  - lib/sequel/plugins/after_initialize.rb
492
508
  - lib/sequel/plugins/association_dependencies.rb
509
+ - lib/sequel/plugins/association_multi_add_remove.rb
493
510
  - lib/sequel/plugins/association_pks.rb
494
511
  - lib/sequel/plugins/association_proxies.rb
495
512
  - lib/sequel/plugins/auto_validations.rb
@@ -600,6 +617,7 @@ files:
600
617
  - spec/extensions/after_initialize_spec.rb
601
618
  - spec/extensions/arbitrary_servers_spec.rb
602
619
  - spec/extensions/association_dependencies_spec.rb
620
+ - spec/extensions/association_multi_add_remove_spec.rb
603
621
  - spec/extensions/association_pks_spec.rb
604
622
  - spec/extensions/association_proxies_spec.rb
605
623
  - spec/extensions/auto_literal_strings_spec.rb