sequel_polymorphic 0.2.0 → 0.2.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 296fe1ecc60ded36fb9747c54c886bda83afc24d
|
4
|
+
data.tar.gz: a20d91dd5237f8ba992ec910fbb5f2cc0c975947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61c2cb72f1852a67ebf6689e9d9042ea80e24635a653cd5b0c51d02ee56fb22e6e280b6b2e24e15956099d091553cbeb418c1747b8bcdeae1dc1dd47541af5c5
|
7
|
+
data.tar.gz: 4e3fda43551679a74fd2170b3c93d8c268f0e48a560c4ec599f1a65a420e90696e45081c3b9236732fce8074f78fcfc8fcce2a054583bd00ebf93678e7a3da5c
|
@@ -31,7 +31,7 @@ module Sequel
|
|
31
31
|
able_type = send(:"#{able}_type")
|
32
32
|
able_id = send(:"#{able}_id")
|
33
33
|
return if able_type.nil? || able_id.nil?
|
34
|
-
klass = constantize
|
34
|
+
klass = self.class.send(:constantize, able_type.capitalize)
|
35
35
|
klass.where(klass.primary_key => able_id)
|
36
36
|
end),
|
37
37
|
:eager_loader => (proc do |eo|
|
@@ -43,7 +43,7 @@ module Sequel
|
|
43
43
|
((id_map[model_able_type] ||= {})[model_able_id] ||= []) << model if !model_able_type.nil? && !model_able_id.nil?
|
44
44
|
end
|
45
45
|
id_map.each do |klass_name, id_map|
|
46
|
-
klass = constantize(klass_name)
|
46
|
+
klass = constantize(klass_name.capitalize)
|
47
47
|
klass.where(klass.primary_key=>id_map.keys).all do |related_obj|
|
48
48
|
id_map[related_obj.pk].each do |model|
|
49
49
|
model.associations[able] = related_obj
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_polymorphic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Dempsey
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sequel
|