neo4apis-activerecord 0.6.0 → 0.6.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: 580b65a076134da3d58184846112a0f2c3691d62
4
- data.tar.gz: 9cb375fca65896d8a0bd1a8f042cd7a98041bb8e
3
+ metadata.gz: f2ed4f89083577a03b71106a03c4dd24872f8736
4
+ data.tar.gz: b90a58d0a0b9f10b7556bef961f5d87cf530c6bb
5
5
  SHA512:
6
- metadata.gz: fc590521e76c4310d35ad43f93d8e81c3dc8aca85312d823564c15595247a91654fff30e27712771975fb6fde8edad557393bd3ee1e2167364e1a0730cb93bc1
7
- data.tar.gz: c868742cd693db9b2fe514209d995dcdf7bbfa295d1a78a25a82d7f778a6dc6868f7290e02a010b305578786d836ece668a6fddc0e83a4a7d47529c41571f60b
6
+ metadata.gz: b8057af9d9498fc9dfac9227041563b2709f85796bba838290deb616ef812f44ea446a459b22bb093f65ffddfa6d93a2c503a53b3c23d9b1236c43bb10dfa4a8
7
+ data.tar.gz: fb3f26d22fe4da3a6e573ee78266f7bad145fe49df1c8de7d21d20d0a52b0e217f2f1da4a5a31468f8d1b9896174d342c845059482e7cb6cf5f59bde5e52b8a3
@@ -145,7 +145,8 @@ module Neo4Apis
145
145
  end
146
146
 
147
147
  def apply_identified_primary_key!(model_class)
148
- identity = identify_primary_key(model_class.column_names, model_class.name)
148
+ identity = ::ActiveRecord::Base.connection.primary_key(model_class.table_name)
149
+ identity ||= identify_primary_key(model_class.column_names, model_class.name)
149
150
  model_class.primary_key = identity if identity
150
151
  end
151
152
 
@@ -20,9 +20,9 @@ module Neo4Apis
20
20
  (columns & %w(id uuid)).first
21
21
  columns.detect do |column|
22
22
  case standardize(column)
23
- when 'id', 'uuid'
23
+ when 'id', 'uuid', /#{standardize(class_name.singularize)}id/, /#{standardize(class_name.pluralize)}id/
24
24
  true
25
- when /#{standardize(class_name)}id/
25
+ when
26
26
  true
27
27
  end
28
28
  end.tap do |found_key| # rubocop:disable Style/MultilineBlockChain
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'neo4apis-activerecord'
6
- s.version = '0.6.0'
6
+ s.version = '0.6.1'
7
7
  s.required_ruby_version = '>= 1.9.1'
8
8
 
9
9
  s.authors = 'Brian Underwood'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4apis-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood