neo4apis-activerecord 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4apis/cli/activerecord.rb +2 -1
- data/lib/neo4apis/table_resolver.rb +2 -2
- data/neo4apis-activerecord.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ed4f89083577a03b71106a03c4dd24872f8736
|
4
|
+
data.tar.gz: b90a58d0a0b9f10b7556bef961f5d87cf530c6bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
25
|
+
when
|
26
26
|
true
|
27
27
|
end
|
28
28
|
end.tap do |found_key| # rubocop:disable Style/MultilineBlockChain
|