sequel-through 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b36de973b7d7a5a8c056388a0f3c2d5227d5c34a562953baeb5594f92d7a4c32
|
4
|
+
data.tar.gz: 633332a805b889735b7ea1e4bb912f2ea6d70b905c030cb3e9b6f1ff161d4530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330ce985ceeeab5b9d1ec998fcca52689718cd083a55bc23dc1351c1d7115464b0504348bbd2dbb27b4c12a0c14f6a798c1fbdc6874f78f74d60f1bc70bdce0c
|
7
|
+
data.tar.gz: 189d343a39b3aa6d94e9f46e970000e2debe74edae7ab1c84647f06697b4d36250446a43d8c0424662fba852b15e045539a93538a6481bc13761f29a9c54dc44
|
data/CHANGELOG.md
ADDED
@@ -9,8 +9,10 @@ module Sequel
|
|
9
9
|
|
10
10
|
module ClassMethods
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
def self.extended mod
|
13
|
+
@@_resolving = false
|
14
|
+
@@_resolver_stack = []
|
15
|
+
end
|
14
16
|
|
15
17
|
# Solves any remaining cyclical associations
|
16
18
|
def solve_cyclical_associations!
|
@@ -18,9 +18,11 @@ module Sequel
|
|
18
18
|
def self.apply mod
|
19
19
|
Sequel.extension :inflector unless "".respond_to?(:pluralize)
|
20
20
|
mod.plugin :many_through_many
|
21
|
+
mod.singleton_class.prepend PrependClassMethods
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
+
# This ensures that our definition of associate jumps the stack
|
25
|
+
module PrependClassMethods
|
24
26
|
|
25
27
|
def associate type, name, opts = OPTS, &block
|
26
28
|
|
@@ -33,10 +35,17 @@ module Sequel
|
|
33
35
|
|
34
36
|
end
|
35
37
|
|
38
|
+
end
|
39
|
+
|
40
|
+
module ClassMethods
|
41
|
+
|
36
42
|
# Associates a related model with the current model using another association
|
37
43
|
# as the intermediary.
|
38
44
|
def associate_through type, name, opts, &block
|
39
|
-
|
45
|
+
|
46
|
+
unless assoc_type = Sequel.synchronize{ASSOCIATION_THROUGH_TYPES[type]}
|
47
|
+
raise Error, "#{type} does not support through associations"
|
48
|
+
end
|
40
49
|
|
41
50
|
result = find_association_path(**opts, name: name, models: self, from_through: true)
|
42
51
|
|
data/sequel-through.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-through
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenaniah Cerny
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
77
|
- ".travis.yml"
|
78
|
+
- CHANGELOG.md
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
- !ruby/object:Gem::Version
|
108
109
|
version: '0'
|
109
110
|
requirements: []
|
110
|
-
rubygems_version: 3.0.
|
111
|
+
rubygems_version: 3.0.3
|
111
112
|
signing_key:
|
112
113
|
specification_version: 4
|
113
114
|
summary: Adds support for :through associations to sequel
|