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
|
||||
|
||||
# fallback do sql query
|
||||
# do query
|
||||
# - stip out * we already search for *query* -
|
||||
query.gsub! '*', ''
|
||||
organizations = Organization.find(
|
||||
:all,
|
||||
:limit => limit,
|
||||
|
|
|
@ -85,6 +85,8 @@ returns
|
|||
end
|
||||
|
||||
# do query
|
||||
# - stip out * we already search for *query* -
|
||||
query.gsub! '*', ''
|
||||
tickets_all = Ticket.select('DISTINCT(tickets.id)').
|
||||
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}%" ).
|
||||
|
|
|
@ -55,7 +55,8 @@ returns
|
|||
end
|
||||
|
||||
# fallback do sql query
|
||||
# do query
|
||||
# - stip out * we already search for *query* -
|
||||
query.gsub! '*', ''
|
||||
users = User.find(
|
||||
:all,
|
||||
:limit => limit,
|
||||
|
|
Loading…
Reference in a new issue