sequel_polymorphic 0.2.0 → 0.2.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: b33d9c8d9736dc22a9e0dbb1ec004b2d19798ca1
4
- data.tar.gz: 7cd68b61757df7f42ffcbd77f651391243b61630
3
+ metadata.gz: 296fe1ecc60ded36fb9747c54c886bda83afc24d
4
+ data.tar.gz: a20d91dd5237f8ba992ec910fbb5f2cc0c975947
5
5
  SHA512:
6
- metadata.gz: aa4aaf04d0abd80335cbf534f4c2e43c2bd4abb5dfcfa9bed3bd45e229760aef1616011c61835ef1bfe40b90f227a43776b623476318c092579325556ecf9253
7
- data.tar.gz: 0d693242a54854001494181e8b1d1d53bd0f93ce8a989e60f170d9853b074e8dfdcfb565fc9e7f2d3be443332426214b241ef9ce006c538b7716455c1a0cbca6
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(able_type)
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
@@ -2,7 +2,7 @@ module Sequel
2
2
  module Plugins
3
3
  module Polymorphic
4
4
 
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
 
7
7
  end # Polymorphic
8
8
  end # Plugins
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.0
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-06-09 00:00:00.000000000 Z
13
+ date: 2015-08-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel