neo4j 8.0.0.alpha.9 → 8.0.0.alpha.10

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: 5af55246f618ffc643e86c81b6a58af2bb638f7f
4
- data.tar.gz: 2f28ba5df62bb6024ba0fde53c60471e0e99e6ad
3
+ metadata.gz: 0609e3850992edd31a7802d07473e088bb09556a
4
+ data.tar.gz: 74ec1af0c63b839f22d545b9073e15092056b16c
5
5
  SHA512:
6
- metadata.gz: dc665609547173f3a61b54de4d6016bdf50582c5a2d0ed001652fe09b23abadfe2d652870da506f815a44d0e5d347d4bfa23e94efd967ecffe2444454ba524e5
7
- data.tar.gz: 7a2ecbe2347f1dcfaddf3fd2d85d55caad8112c20feb8465787f6bb1458175a1fdf55af0dc22740f1ccea7e4776a4bc927baa4a83444666588a113824b061179
6
+ metadata.gz: dee8942d71e26463e1bd78bfe83bbc597ba38178efaa53faf52eb4121acd53673e8e45d5b0c5c33dfb8439b11010d9d2f261d8db3bc3a511aa102033c99d1948
7
+ data.tar.gz: 9454917d185fb560c7f9a4d6d50a6a78b4e4e0b64897269b588988c39e838ac777edae1625c458268659e363365800691f99ae4cfd27ed630d06af284fc8a165
@@ -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
- Neo4j::ActiveNode::Labels::WRAPPED_CLASSES.clear
9
- Neo4j::ActiveNode::Labels.clear_wrapped_models
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
@@ -58,10 +58,7 @@ module Neo4j
58
58
  end
59
59
 
60
60
  def setup!(neo4j_config = nil)
61
- support_deprecated_session_configs!(neo4j_config)
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.tap do |scheme|
89
- fail "Invalid scheme for NEO4J_URL: #{scheme}" if !%w(http bolt).include?(scheme)
90
- end
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
- HashWithIndifferentAccess.new(YAML.load(ERB.new(yaml_path.read).result)[Rails.env])
103
- else
104
- {}
105
- end
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
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '8.0.0.alpha.9'
2
+ VERSION = '8.0.0.alpha.10'
3
3
  end
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.9
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-14 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter