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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6203bf35d7fd3a6139b28adebf01e00a83f0e26c
4
- data.tar.gz: 39828e6856dda78320335b585e7f121b9d91e0be
3
+ metadata.gz: 6811ed3c3bf654e8fddaa172bafa0ae4437fe2a1
4
+ data.tar.gz: fc0f1bd40634d0536f4ec1b6c57ca30ab9e87066
5
5
  SHA512:
6
- metadata.gz: 315094a2fe7da66ec9e7e68ae0261217c47bcb200f93f71b96b9cd8eeb3d98b5c2cabea567cd388887bada191b615e242804bce12b9e8cf55670e5b986d72257
7
- data.tar.gz: 8219071feeb685125eb6a3e13b735a9bcf0e28901f2d373f45d44cfa9f557272a7ab37b2702f043dc80d70b7f4cb5a034d6bd120f70e6d020e1aa7625b26d90c
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 = if coder = model_class.serialized_attributes[column]
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
@@ -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.5.1'
6
+ s.version = '0.5.2'
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood