neo4j-core 6.0.0.alpha.5 → 6.0.0.alpha.6

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: da1d3afa114538d40feb6d6765112f282c13ebee
4
- data.tar.gz: fe9f7472deaddd1123e62ca73a02ed3ec70431b7
3
+ metadata.gz: e99811330db569bee176268f6dd5cf8bb062382e
4
+ data.tar.gz: 1905f83e3713bfbddd79464305c294c69fcbcab0
5
5
  SHA512:
6
- metadata.gz: 36fa2080886b9b51eb29ec518399153474e4f113c7530ff137a55453397d7c3ec1f3407178d1d3ff3d28b4aacf85c0ea5740f47e646d1945cce524233c48946d
7
- data.tar.gz: 94a3b1aadca366cdf2485de538fe0b6fc95e570f811ee8415b4826a6e4ab17d0a896b46e99f8f4d4f1ef253dba8afba65d37d64606ee5c1c6bb2405262771c9b
6
+ metadata.gz: d44de7be2d36df45456cab02edb58aacbe2bd3913e19a5e1af213e8e30b5a855492c3e02c5bb3f34b68a17707c5b6a0d83eb1985f80a2899febfa484c055561f
7
+ data.tar.gz: 260e1be9fd3fcef24c776c0e32b58041cc06ecf89b1cd0f676791d74a472936ed478eaafe2e505e5e56cb7944c5e5023705b6007ffc1f9882edea5071199c8a9
@@ -32,7 +32,7 @@ module Neo4j
32
32
  self.class.instrument_queries(queries)
33
33
 
34
34
  execution_results = queries.map do |query|
35
- engine.execute(query.cypher, HashWithIndifferentAccess.new(query.parameters))
35
+ engine.execute(query.cypher, indifferent_params(query))
36
36
  end
37
37
 
38
38
  Responses::Embedded.new(execution_results).results
@@ -75,6 +75,12 @@ module Neo4j
75
75
 
76
76
  private
77
77
 
78
+ def indifferent_params(query)
79
+ params = query.parameters
80
+ params.each { |k, v| params[k] = HashWithIndifferentAccess.new(params[k]) if v.is_a?(Hash) && !v.respond_to?(:nested_under_indifferent_access) }
81
+ HashWithIndifferentAccess.new(params)
82
+ end
83
+
78
84
  def engine
79
85
  @engine ||= Java::OrgNeo4jCypherJavacompat::ExecutionEngine.new(@graph_db)
80
86
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '6.0.0.alpha.5'
3
+ VERSION = '6.0.0.alpha.6'
4
4
  end
5
5
  end
@@ -147,12 +147,18 @@ module Neo4j
147
147
  ActiveSupport::Notifications.instrument('neo4j.cypher_query', params: params, context: options[:context],
148
148
  cypher: query, pretty_cypher: options[:pretty_cypher], params: params) do
149
149
  @engine ||= Java::OrgNeo4jCypherJavacompat::ExecutionEngine.new(@graph_db)
150
- @engine.execute(query, HashWithIndifferentAccess.new(params))
150
+ @engine.execute(query, indifferent_params(params))
151
151
  end
152
152
  rescue StandardError => e
153
153
  raise Neo4j::Session::CypherError.new(e.message, e.class, 'cypher error')
154
154
  end
155
155
 
156
+ def indifferent_params(params)
157
+ return {} unless params
158
+ params.each { |k, v| params[k] = HashWithIndifferentAccess.new(params[k]) if v.is_a?(Hash) && !v.respond_to?(:nested_under_indifferent_access) }
159
+ HashWithIndifferentAccess.new(params)
160
+ end
161
+
156
162
  def query_default_return(as)
157
163
  " RETURN #{as}"
158
164
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.alpha.5
4
+ version: 6.0.0.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Chris Grigg, Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-24 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty