Skip to content

Commit 54140af

Browse files
committed
Fix whereRaw parsing
1 parent ba0f992 commit 54140af

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [0.2.5] - 2017-10-04
88
### Fixed
9-
- parsing of nested, exists, and column where clauses.
9+
- parsing of nested, exists, raw, and column where clauses.
1010

1111
## [0.2.4] - 2017-10-03
1212
### Added

Diff for: src/CachedBuilder.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ protected function getWhereClauses(array $wheres = []) : string
8585
}
8686

8787
if ($where['type'] === 'Column') {
88-
return "{$where['boolean']}_{$where['first']}_{$where['operator']}_{$where['second']}";
88+
return "_{$where['boolean']}_{$where['first']}_{$where['operator']}_{$where['second']}";
89+
}
90+
91+
if ($where['type'] === 'raw') {
92+
return "_{$where['boolean']}_" . str_slug($where['sql']);
8993
}
9094

9195
$value = array_get($where, 'value');
@@ -102,7 +106,6 @@ protected function getWhereClauses(array $wheres = []) : string
102106
}) ?: '';
103107
}
104108

105-
106109
protected function getWithModels() : string
107110
{
108111
$eagerLoads = collect($this->eagerLoad);

Diff for: tests/Unit/CachedBuilderTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -481,4 +481,10 @@ public function testColumnsRelationshipWhereClauseParsing()
481481
// ???
482482
$this->markTestIncomplete();
483483
}
484+
485+
public function testRawWhereClauseParsing()
486+
{
487+
// ->whereRaw(...)
488+
$this->markTestIncomplete();
489+
}
484490
}

0 commit comments

Comments
 (0)