sequel 4.42.0 → 4.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 950d9818b7e057e8728dde0e8bc5460dc3a91679
4
- data.tar.gz: e0cec40c01a7eeb1a6ca8d6d993155a74b032f9d
3
+ metadata.gz: 1d84f8a9b0d5ee524d044add19f1c9adca2c642a
4
+ data.tar.gz: 5139deab1c3ddfc8e6a9482f8f711d86f35ab261
5
5
  SHA512:
6
- metadata.gz: e0bda9bf194bd56954f1647775b8de2d6ed2ace58691c32cf58f2d11717980492dbd0f2dad3f4a13ee2cc45eaa033e2b18456b556b9166a24163e1f7eb8fd41d
7
- data.tar.gz: 5c8f48cee321a25826ac480fa09c82289f105d5ff793fee90a58c47f9b91ae4daf2ccd0dbd516391c45fff54ee3036726a9cb0fd22a7d832d77a86e98ddd866f
6
+ metadata.gz: 12202167088c4caef4db81fc6fa6ed35d2104dc993f1be93d45984b887ba9b698395e576be6537457f2cf8123abed75c85175fa1193e5ef7d3c313584908be06
7
+ data.tar.gz: 9a4d6933538023d4d7b0ea38c18b317557e01a1c2df0391e9a06a8732ac1d9a1f7525e82fe338ff57052c93973a8f979c757c2bcc1730df9f22ad3f28abad665
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 4.42.1 (2017-01-12)
2
+
3
+ * Make dataset_module inherited to subclasses when using the single_table_inheritance plugin (jeremyevans) (#1284)
4
+
1
5
  === 4.42.0 (2017-01-01)
2
6
 
3
7
  * Handle eager load callbacks correctly for one_to_one associations with orders or offsets when window functions are not supported (jeremyevans)
@@ -185,6 +185,13 @@ module Sequel
185
185
 
186
186
  private
187
187
 
188
+ # Extend the sti dataset with the module when extending the main
189
+ # dataset.
190
+ def dataset_extend(mod, opts=OPTS)
191
+ @sti_dataset = @sti_dataset.with_extend(mod)
192
+ super
193
+ end
194
+
188
195
  # If calling set_dataset manually, make sure to set the dataset
189
196
  # row proc to one that handles inheritance correctly.
190
197
  def set_dataset_row_proc(ds)
@@ -8,7 +8,7 @@ module Sequel
8
8
  MINOR = 42
9
9
  # The tiny version of Sequel. Usually 0, only bumped for bugfix
10
10
  # releases that fix regressions from previous versions.
11
- TINY = 0
11
+ TINY = 1
12
12
 
13
13
  # The version of Sequel you are using, as a string (e.g. "2.11.0")
14
14
  VERSION = [MAJOR, MINOR, TINY].join('.').freeze
@@ -58,6 +58,26 @@ describe Sequel::Model, "single table inheritance plugin" do
58
58
  StiTest.all.collect{|x| x.class}.must_equal [StiTest]
59
59
  end
60
60
 
61
+ it "should inherit dataset_modules correctly in subclass" do
62
+ StiTest.dataset_module{def foo; 1; end}
63
+ Object.send(:remove_const, :StiTestSub1)
64
+ Object.send(:remove_const, :StiTestSub2)
65
+ class ::StiTestSub1 < StiTest; end
66
+ StiTestSub1.dataset_module{def bar; 2; end}
67
+ class ::StiTestSub2 < StiTestSub1; end
68
+ StiTestSub2.dataset_module{def baz; 3; end}
69
+
70
+ StiTest.dataset.foo.must_equal 1
71
+ proc{StiTest.dataset.bar}.must_raise NoMethodError
72
+ proc{StiTest.dataset.baz}.must_raise NoMethodError
73
+ StiTestSub1.dataset.foo.must_equal 1
74
+ StiTestSub1.dataset.bar.must_equal 2
75
+ proc{StiTestSub1.dataset.baz}.must_raise NoMethodError
76
+ StiTestSub2.dataset.foo.must_equal 1
77
+ StiTestSub2.dataset.bar.must_equal 2
78
+ StiTestSub2.dataset.baz.must_equal 3
79
+ end
80
+
61
81
  it "should fallback to the main class if the sti_key field is empty or nil without calling constantize" do
62
82
  called = false
63
83
  StiTest.meta_def(:constantize) do |s|
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: 4.42.0
4
+ version: 4.42.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-01 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest