Permalink
Browse files

Fix rubocop issue

  • Loading branch information...
cheerfulstoic committed Sep 9, 2015
1 parent 1e7ac9b commit 03115945182931bcb36af54a12f8ae63075aa5a1
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/neo4j/active_node/query/query_proxy_methods.rb
@@ -32,13 +32,11 @@ def last(target = nil)
def first_and_last(func, target)
new_query, pluck_proc = if self.query.clause?(:order)
new_query = self.query.with(identity)
pluck_proc = proc { |var| "#{func}(COLLECT(#{var})) as #{var}" }
[new_query, pluck_proc]
[self.query.with(identity),
proc { |var| "#{func}(COLLECT(#{var})) as #{var}" }]
else
new_query = self.order(order_property).limit(1)
pluck_proc = proc { |var| var }
[new_query, pluck_proc]
[self.order(order_property).limit(1),
proc { |var| var }]
end
result = query_with_target(target) do |var|
final_pluck = pluck_proc.call(var)

0 comments on commit 0311594

Please sign in to comment.