diff --git a/app/models/organization/search.rb b/app/models/organization/search.rb index ec008f731..62d6e4be4 100644 --- a/app/models/organization/search.rb +++ b/app/models/organization/search.rb @@ -68,7 +68,7 @@ returns # fallback do sql query # - stip out * we already search for *query* - - query.delete! '*', '' + query.delete! '*' organizations = Organization.where( 'name LIKE ? OR note LIKE ?', "%#{query}%", "%#{query}%" ).order('name').limit(limit) diff --git a/app/models/ticket/search.rb b/app/models/ticket/search.rb index 955743154..e045b3c79 100644 --- a/app/models/ticket/search.rb +++ b/app/models/ticket/search.rb @@ -146,7 +146,7 @@ returns # do query # - stip out * we already search for *query* - if query - query.delete! '*', '' + query.delete! '*' tickets_all = Ticket.select('DISTINCT(tickets.id)') .where(access_condition) .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}%" ) diff --git a/app/models/user/search.rb b/app/models/user/search.rb index 59f2a6bc6..6316d4bde 100644 --- a/app/models/user/search.rb +++ b/app/models/user/search.rb @@ -68,7 +68,7 @@ returns # fallback do sql query # - stip out * we already search for *query* - - query.delete! '*', '' + query.delete! '*' if params[:role_ids] users = User.joins(:roles).where( 'roles.id' => params[:role_ids] ).where( '(users.firstname LIKE ? or users.lastname LIKE ? or users.email LIKE ?) AND users.id != 1', "%#{query}%", "%#{query}%", "%#{query}%",