dynamic-active-model 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 +4 -4
- data/lib/dynamic-active-model/relations.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7571255175f1555d4f3980437f6b83616103cb0f05fc5b97ec0b158d61c0053c
|
4
|
+
data.tar.gz: 0e488c069a054e738d3371278faf1503cdca374e3c0cc9f08bafadce39d5fb38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce391d25b3b91ce0a1e1bb9e462323c4a73db1efef2fc2ad969076e58b2015b46aa89336afb7bc815e04a40e9adde194e30105f8bb2a41657907329f967a377
|
7
|
+
data.tar.gz: a9b64ca5089117f41ce26770e5ffa788cfbb6d4b37aeaf01eb201e0d2ba942565bfcb62f9c90cfe481e44dde6aac78f5e88f19024e847b44b6055a18a2c4445f
|
@@ -23,9 +23,9 @@ module DynamicActiveModel
|
|
23
23
|
|
24
24
|
@database.models.each do |model|
|
25
25
|
model.column_names.each do |column_name|
|
26
|
-
next unless foreign_key_to_models[column_name]
|
26
|
+
next unless foreign_key_to_models[column_name.downcase]
|
27
27
|
|
28
|
-
foreign_key_to_models[column_name].each do |foreign_model, relationship_name|
|
28
|
+
foreign_key_to_models[column_name.downcase].each do |foreign_model, relationship_name|
|
29
29
|
next if foreign_model == model
|
30
30
|
|
31
31
|
add_relationships(relationship_name, model, foreign_model, column_name)
|
@@ -62,8 +62,8 @@ module DynamicActiveModel
|
|
62
62
|
def create_foreign_key_to_model_map
|
63
63
|
@foreign_keys.values.each_with_object({}) do |foreign_key, hsh|
|
64
64
|
foreign_key.keys.each do |key, relationship_name|
|
65
|
-
hsh[key] ||= []
|
66
|
-
hsh[key] << [foreign_key.model, relationship_name]
|
65
|
+
hsh[key.downcase] ||= []
|
66
|
+
hsh[key.downcase] << [foreign_key.model, relationship_name]
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|