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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/sequel/plugins/single_table_inheritance.rb +7 -0
- data/lib/sequel/version.rb +1 -1
- data/spec/extensions/single_table_inheritance_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d84f8a9b0d5ee524d044add19f1c9adca2c642a
|
4
|
+
data.tar.gz: 5139deab1c3ddfc8e6a9482f8f711d86f35ab261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/sequel/version.rb
CHANGED
@@ -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 =
|
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.
|
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-
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|