Improved std. fallback sql.
This commit is contained in:
parent
9d0937715d
commit
1a64256546
3 changed files with 6 additions and 2 deletions
|
@ -39,7 +39,8 @@ returns
|
||||||
end
|
end
|
||||||
|
|
||||||
# fallback do sql query
|
# fallback do sql query
|
||||||
# do query
|
# - stip out * we already search for *query* -
|
||||||
|
query.gsub! '*', ''
|
||||||
organizations = Organization.find(
|
organizations = Organization.find(
|
||||||
:all,
|
:all,
|
||||||
:limit => limit,
|
:limit => limit,
|
||||||
|
|
|
@ -85,6 +85,8 @@ returns
|
||||||
end
|
end
|
||||||
|
|
||||||
# do query
|
# do query
|
||||||
|
# - stip out * we already search for *query* -
|
||||||
|
query.gsub! '*', ''
|
||||||
tickets_all = Ticket.select('DISTINCT(tickets.id)').
|
tickets_all = Ticket.select('DISTINCT(tickets.id)').
|
||||||
where(conditions).
|
where(conditions).
|
||||||
where( '( `tickets`.`title` LIKE ? OR `tickets`.`number` LIKE ? OR `ticket_articles`.`body` LIKE ? OR `ticket_articles`.`from` LIKE ? OR `ticket_articles`.`to` LIKE ? OR `ticket_articles`.`subject` LIKE ?)', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%" ).
|
where( '( `tickets`.`title` LIKE ? OR `tickets`.`number` LIKE ? OR `ticket_articles`.`body` LIKE ? OR `ticket_articles`.`from` LIKE ? OR `ticket_articles`.`to` LIKE ? OR `ticket_articles`.`subject` LIKE ?)', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%" ).
|
||||||
|
|
|
@ -55,7 +55,8 @@ returns
|
||||||
end
|
end
|
||||||
|
|
||||||
# fallback do sql query
|
# fallback do sql query
|
||||||
# do query
|
# - stip out * we already search for *query* -
|
||||||
|
query.gsub! '*', ''
|
||||||
users = User.find(
|
users = User.find(
|
||||||
:all,
|
:all,
|
||||||
:limit => limit,
|
:limit => limit,
|
||||||
|
|
Loading…
Reference in a new issue