neo4j 8.0.0.alpha.9 → 8.0.0.alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/neo4j/active_node/has_n.rb +1 -1
- data/lib/neo4j/active_node/labels/reloading.rb +11 -2
- data/lib/neo4j/railtie.rb +14 -11
- data/lib/neo4j/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0609e3850992edd31a7802d07473e088bb09556a
|
4
|
+
data.tar.gz: 74ec1af0c63b839f22d545b9073e15092056b16c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dee8942d71e26463e1bd78bfe83bbc597ba38178efaa53faf52eb4121acd53673e8e45d5b0c5c33dfb8439b11010d9d2f261d8db3bc3a511aa102033c99d1948
|
7
|
+
data.tar.gz: 9454917d185fb560c7f9a4d6d50a6a78b4e4e0b64897269b588988c39e838ac777edae1625c458268659e363365800691f99ae4cfd27ed630d06af284fc8a165
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [8.0.0.alpha.10] 2016-09-16
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Remove blank objects from association results to be compatible with `ActiveRecord` (see #1276 / thanks klobuczek)
|
12
|
+
- Allow https scheme in the NEO4J_URL (see #1287 / thanks jacob-ewald)
|
13
|
+
|
8
14
|
## [8.0.0.alpha.9] 2016-09-14
|
9
15
|
|
10
16
|
### Fixed
|
@@ -386,7 +386,7 @@ module Neo4j::ActiveNode
|
|
386
386
|
|
387
387
|
define_method_unless_defined("#{name.to_s.singularize}_ids=") do |ids|
|
388
388
|
clear_deferred_nodes_for_association(name)
|
389
|
-
association_proxy(name).replace_with(ids)
|
389
|
+
association_proxy(name).replace_with(Array(ids).reject(&:blank?))
|
390
390
|
end
|
391
391
|
|
392
392
|
define_method_unless_defined("#{name.to_s.singularize}_neo_ids") do
|
@@ -5,8 +5,17 @@ module Neo4j::ActiveNode::Labels
|
|
5
5
|
MODELS_TO_RELOAD = []
|
6
6
|
|
7
7
|
def self.reload_models!
|
8
|
-
|
9
|
-
|
8
|
+
MODELS_TO_RELOAD.each(&:constantize)
|
9
|
+
MODELS_TO_RELOAD.clear
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
def before_remove_const
|
14
|
+
associations.each_value(&:queue_model_refresh!)
|
15
|
+
MODELS_FOR_LABELS_CACHE.clear
|
16
|
+
WRAPPED_CLASSES.each { |c| MODELS_TO_RELOAD << c.name }
|
17
|
+
WRAPPED_CLASSES.clear
|
18
|
+
end
|
10
19
|
end
|
11
20
|
end
|
12
21
|
end
|
data/lib/neo4j/railtie.rb
CHANGED
@@ -58,10 +58,7 @@ module Neo4j
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def setup!(neo4j_config = nil)
|
61
|
-
|
62
|
-
|
63
|
-
session_data = neo4j_config.session.empty? ? yaml_config_data : neo4j_config.session
|
64
|
-
type, url, path, options, wait_for_connection = session_data.values_at(:type, :path, :url, :options, :wait_for_connection)
|
61
|
+
type, url, path, options, wait_for_connection = final_config!(neo4j_config).values_at(:type, :path, :url, :options, :wait_for_connection)
|
65
62
|
register_neo4j_cypher_logging(type || default_session_type)
|
66
63
|
|
67
64
|
Neo4j::SessionManager.open_neo4j_session(type || default_session_type,
|
@@ -70,6 +67,12 @@ module Neo4j
|
|
70
67
|
options || {})
|
71
68
|
end
|
72
69
|
|
70
|
+
def final_config!(neo4j_config)
|
71
|
+
support_deprecated_session_configs!(neo4j_config)
|
72
|
+
|
73
|
+
neo4j_config.session.empty? ? yaml_config_data : neo4j_config.session
|
74
|
+
end
|
75
|
+
|
73
76
|
def support_deprecated_session_configs!(neo4j_config)
|
74
77
|
ActiveSupport::Deprecation.warn('neo4j.config.sessions is deprecated, please use neo4j.config.session (not an array)') if neo4j_config.sessions.present?
|
75
78
|
neo4j_config.session ||= (neo4j_config.sessions && neo4j_config.sessions[0]) || {}
|
@@ -85,9 +88,9 @@ module Neo4j
|
|
85
88
|
|
86
89
|
def default_session_type
|
87
90
|
if ENV['NEO4J_URL']
|
88
|
-
URI(ENV['NEO4J_URL']).scheme
|
89
|
-
|
90
|
-
|
91
|
+
scheme = URI(ENV['NEO4J_URL']).scheme
|
92
|
+
fail "Invalid scheme for NEO4J_URL: #{scheme}" if !%w(http https bolt).include?(scheme)
|
93
|
+
scheme == 'https' ? 'http' : scheme
|
91
94
|
else
|
92
95
|
ENV['NEO4J_TYPE'] || :http
|
93
96
|
end.to_sym
|
@@ -99,10 +102,10 @@ module Neo4j
|
|
99
102
|
|
100
103
|
def yaml_config_data
|
101
104
|
@yaml_config_data ||= if yaml_path
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
HashWithIndifferentAccess.new(YAML.load(ERB.new(yaml_path.read).result)[Rails.env])
|
106
|
+
else
|
107
|
+
{}
|
108
|
+
end
|
106
109
|
end
|
107
110
|
|
108
111
|
def yaml_path
|
data/lib/neo4j/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.0.alpha.
|
4
|
+
version: 8.0.0.alpha.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Brian Underwood, Chris Grigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|