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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67d4e71c097cafd08ed7e9c3ed2ffd4d8b22b5787fd2f6ab498a709b75de5215
4
- data.tar.gz: a5cad0b2293d861f93bdf9d6c8fbc983ca9c4af1ab9bb60c22216c074e2b01c2
3
+ metadata.gz: 7571255175f1555d4f3980437f6b83616103cb0f05fc5b97ec0b158d61c0053c
4
+ data.tar.gz: 0e488c069a054e738d3371278faf1503cdca374e3c0cc9f08bafadce39d5fb38
5
5
  SHA512:
6
- metadata.gz: 5939469d103fb9c6a6d71ea987e6b0f8fe9c117d1014ca5d752c25307c1d5ff586d64cebae3571cc1eb276e9cfd760e577bae2066c9812223055c1f309b0cb50
7
- data.tar.gz: 422a33565554689d2055122cc45234e7fd4c7f1f766f018b4fd080df6c86051cc79d950fec706702f489bd225793e84b3dc1d4cc7b66ae2dd2667fe507e0f5f1
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic-active-model
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
  - Doug Youch