Skip to content

Commit

Permalink
Merge pull request #109 from RobMasters/fix_relation_label
Browse files Browse the repository at this point in the history
Fixed syntax error when building namespaced relation label
  • Loading branch information
Mulkave committed Aug 4, 2015
2 parents 7f89a2f + f2ebac6 commit b281548
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Vinelab/NeoEloquent/Query/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function wrapLabel($label)
*/
public function prepareRelation($relation, $related)
{
return "rel_". mb_strtolower($relation) .'_'. $related .":{$relation}";
return "`rel_". mb_strtolower($relation) .'_'. $related ."`:`{$relation}`";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Vinelab/NeoEloquent/Query/GrammarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testPreparingLabel()

public function testPreparingRelationName()
{
$this->assertEquals('rel_posted_post:POSTED', $this->grammar->prepareRelation('POSTED', 'post'));
$this->assertEquals('`rel_posted_post`:`POSTED`', $this->grammar->prepareRelation('POSTED', 'post'));
}

public function testNormalizingLabels()
Expand Down

0 comments on commit b281548

Please sign in to comment.