reverse commit, which produces a bug

This commit is contained in:
Patrick Kohan 2015-01-22 17:31:17 +01:00
parent 5330572c25
commit 9cc7a59fb5

View File

@ -300,7 +300,7 @@ func (s *Scope) joinsSql() string {
func (scope *Scope) prepareQuerySql() { func (scope *Scope) prepareQuerySql() {
if scope.Search.Raw { if scope.Search.Raw {
scope.Raw(strings.TrimRight(strings.TrimLeft(scope.CombinedConditionSql(), "WHERE ("), ")")) scope.Raw(strings.TrimLeft(scope.CombinedConditionSql(), "WHERE "))
} else { } else {
scope.Raw(fmt.Sprintf("SELECT %v %v FROM %v %v", scope.topSql(), scope.selectSql(), scope.QuotedTableName(), scope.CombinedConditionSql())) scope.Raw(fmt.Sprintf("SELECT %v %v FROM %v %v", scope.topSql(), scope.selectSql(), scope.QuotedTableName(), scope.CombinedConditionSql()))
} }