neo4apis-activerecord 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4apis/activerecord.rb +1 -5
- data/lib/neo4apis/cli/activerecord.rb +3 -3
- 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: 6811ed3c3bf654e8fddaa172bafa0ae4437fe2a1
|
4
|
+
data.tar.gz: fc0f1bd40634d0536f4ec1b6c57ca30ab9e87066
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd87fb7dfb12e55ca4beb4d17e0c4599f07b33d337f0b904f8e5cb0e81dd2b07b4f156b3d2bf0d15ff29f0ef705376dc6afe32ec305ef154326e5d4b691a144
|
7
|
+
data.tar.gz: 29cc32da3846f63a07cf7442804b4e3a0ac54572b28e718137fe9e33d775dfccd43b5da8e55a3c9084c15f3cbb79dd3f529b9465f5fa452080e3dcbd20138c93
|
@@ -42,11 +42,7 @@ module Neo4Apis
|
|
42
42
|
object_data = OpenStruct.new
|
43
43
|
|
44
44
|
object.attributes.each do |column, value|
|
45
|
-
v =
|
46
|
-
coder.dump(value)
|
47
|
-
else
|
48
|
-
value
|
49
|
-
end
|
45
|
+
v = object.attributes_for_coder[column] || value
|
50
46
|
object_data.send("#{column}=", v)
|
51
47
|
end
|
52
48
|
|
@@ -47,7 +47,7 @@ module Neo4Apis
|
|
47
47
|
|
48
48
|
Rails.application.eager_load!
|
49
49
|
|
50
|
-
import_models_or_tables(ActiveRecord::Base.descendants)
|
50
|
+
import_models_or_tables(*::ActiveRecord::Base.descendants)
|
51
51
|
end
|
52
52
|
|
53
53
|
private
|
@@ -93,8 +93,6 @@ module Neo4Apis
|
|
93
93
|
|
94
94
|
|
95
95
|
def get_model(model_or_table_name)
|
96
|
-
return model_or_table_name if model_or_table_name.is_a?(ActiveRecord::Base)
|
97
|
-
|
98
96
|
get_model_class(model_or_table_name).tap do |model_class|
|
99
97
|
if options[:identify_model]
|
100
98
|
apply_identified_table_name!(model_class)
|
@@ -105,6 +103,8 @@ module Neo4Apis
|
|
105
103
|
end
|
106
104
|
|
107
105
|
def get_model_class(model_or_table_name)
|
106
|
+
return model_or_table_name if model_or_table_name.ancestors.include?(::ActiveRecord::Base)
|
107
|
+
|
108
108
|
model_class = model_or_table_name
|
109
109
|
model_class = model_or_table_name.classify unless model_or_table_name.match(/^[A-Z]/)
|
110
110
|
model_class.constantize
|