neo4apis-activerecord 0.7.1 → 0.8.0

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: 3958fff387cdc270f1c65a4853679fa988592119
4
- data.tar.gz: 44f90eb1b619b2dddba6cf4470877a0d45085778
3
+ metadata.gz: b53fa80a0d3d755b2a75ef5eae630959abcbe30d
4
+ data.tar.gz: 23bb41f32bcb6a0dcaeaf0175d5346c232fb1f09
5
5
  SHA512:
6
- metadata.gz: e7a0f2ca143b84999aaf8682b1005ecae5815ac14694477c917b717347b037b5fddadf4515981494716daf00de37fb580b26e208ad7a33f84c814cc9378dfe7b
7
- data.tar.gz: 8321d3f03c821de20d9ba1fdc3b40637edf0c963477199f7b9708be5f8d1cbb6b784943da33cc5d95083ed4d3cbfb1d3900b41c2e2031b2d29e647a7a044aac8
6
+ metadata.gz: 6fb8cf560adb2bb673391278770368ff33b6485b28d12a8c7ee55b6cd98d517de9bbf44caf50ee1408bc0360cf8eb605fbda938d100adac1595f96677fd73df2
7
+ data.tar.gz: ad7443131b73bf5cbfc47a727cd0faa34da0d2129a248fa21eb8e067e9ee7ac239c257dc5572ec1f21e0a0db16f0eaa0109e76646c1c4a37204245625a034582
@@ -105,7 +105,7 @@ module Neo4Apis
105
105
  NEO4APIS_CLIENT_CLASS = ::Neo4Apis::ActiveRecord
106
106
 
107
107
  def neo4apis_client
108
- @neo4apis_client ||= NEO4APIS_CLIENT_CLASS.new(Neo4j::Session.open(:server_db, parent_options[:neo4j_url]),
108
+ @neo4apis_client ||= NEO4APIS_CLIENT_CLASS.new(specified_neo4j_session,
109
109
  import_belongs_to: import_association?(:belongs_to),
110
110
  import_has_one: import_association?(:has_one),
111
111
  import_has_many: import_association?(:has_many))
@@ -1,6 +1,9 @@
1
1
  require 'neo4apis/table_resolver'
2
2
 
3
3
  module Neo4Apis
4
+ class UnfoundTableError < StandardError
5
+ end
6
+
4
7
  module ModelResolver
5
8
  def self.included(included_class)
6
9
  included_class.send(:include, TableResolver)
@@ -28,7 +31,7 @@ module Neo4Apis
28
31
 
29
32
  def apply_identified_model_associations!(model_class)
30
33
  model_class.columns.each do |column|
31
- match = column.match(/^(.+)_id$/i) || column.match(/^(.+)id$/i)
34
+ match = column.name.match(/^(.+)_id$/i) || column.name.match(/^(.+)id$/i)
32
35
  next if not match
33
36
 
34
37
  begin
@@ -1,9 +1,9 @@
1
1
 
2
2
  module Neo4Apis
3
+ class UnfoundTableError < StandardError
4
+ end
5
+
3
6
  module TableResolver
4
- class UnfoundTableError < StandardError
5
- end
6
-
7
7
  class UnfoundPrimaryKeyError < StandardError
8
8
  end
9
9
 
@@ -12,7 +12,7 @@ module Neo4Apis
12
12
  tables.detect do |table_name|
13
13
  potential_table_comparisons.include?(standardize(table_name))
14
14
  end.tap do |found_name| # rubocop:disable Style/MultilineBlockChain
15
- fail UnfoundTableError, "Could not find a table for #{class_name}." if found_name.nil?
15
+ puts "WARNING: Could not find a table for #{class_name}." if found_name.nil?
16
16
  end
17
17
  end
18
18
 
@@ -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.7.1'
6
+ s.version = '0.8.0'
7
7
  s.required_ruby_version = '>= 1.9.1'
8
8
 
9
9
  s.authors = 'Brian Underwood'
@@ -18,6 +18,6 @@ A ruby gem using neo4apis to make importing SQL data to neo4j easy
18
18
  s.require_path = 'lib'
19
19
  s.files = Dir.glob('{bin,lib,config}/**/*') + %w(README.md Gemfile neo4apis-activerecord.gemspec)
20
20
 
21
- s.add_dependency('neo4apis', '~> 0.6.0')
21
+ s.add_dependency('neo4apis', '>= 0.8.1')
22
22
  s.add_dependency('activerecord', '~> 4.0')
23
23
  end
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.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: neo4apis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.0
19
+ version: 0.8.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.0
26
+ version: 0.8.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement