Skip to content

Commit

Permalink
Merge branch '6.1.x'
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.md
  • Loading branch information
cheerfulstoic committed May 12, 2016
2 parents 6c4c29d + 0690fb1 commit 8befd27
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

- Removed httparty dependency which is no longer used (thanks isaacsanders / see #257)

## [6.1.4] - 05-12-2016

### Added

- `detach_delete` method for `Query` API for `DETACH DELETE` clause introduced in Neo4j 2.3

## [6.1.3] - 04-28-2016

### Fixed
Expand Down
6 changes: 5 additions & 1 deletion lib/neo4j-core/query.rb
Expand Up @@ -154,7 +154,11 @@ def inspect
# DELETE clause
# @return [Query]

METHODS = %w(start match optional_match using where create create_unique merge set on_create_set on_match_set remove unwind delete with return order skip limit)
# @method detach_delete *args
# DETACH DELETE clause
# @return [Query]

METHODS = %w(start match optional_match using where create create_unique merge set on_create_set on_match_set remove unwind delete detach_delete with return order skip limit)
BREAK_METHODS = %(with)

CLAUSIFY_CLAUSE = proc { |method| const_get(method.to_s.split('_').map(&:capitalize).join + 'Clause') }
Expand Down
4 changes: 4 additions & 0 deletions lib/neo4j-core/query_clauses.rb
Expand Up @@ -487,6 +487,10 @@ def clause_color
end
end

class DetachDeleteClause < DeleteClause
KEYWORD = 'DETACH DELETE'
end

class OrderClause < Clause
KEYWORD = 'ORDER BY'

Expand Down
2 changes: 1 addition & 1 deletion lib/neo4j-core/version.rb
@@ -1,5 +1,5 @@
module Neo4j
module Core
VERSION = '6.1.3'
VERSION = '6.1.4'
end
end
20 changes: 20 additions & 0 deletions spec/neo4j-core/unit/query_spec.rb
Expand Up @@ -749,6 +749,26 @@ def self.it_generates(cypher, params = {})
end
end

# DETACH DELETE

describe '#delete' do
describe ".detach_delete('n')" do
it_generates 'DETACH DELETE n'
end

describe '.detach_delete(:n)' do
it_generates 'DETACH DELETE n'
end

describe ".detach_delete('n', :o)" do
it_generates 'DETACH DELETE n, o'
end

describe ".detach_delete(['n', :o])" do
it_generates 'DETACH DELETE n, o'
end
end

# SET

describe '#set_props' do
Expand Down

0 comments on commit 8befd27

Please sign in to comment.