diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-31 09:45:51 -0400 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-31 09:45:51 -0400 |
| commit | 4b05489a75fc090989c21f4927d092ccb6f3e02e (patch) | |
| tree | 69196b2c8cc258fc882d40a150f22aa438b5f982 | |
| parent | c2ccb2f76a9beef573477a97a148b3f72996a3e9 (diff) | |
clients: limit search to 10 clients
| -rw-r--r-- | app/controllers/clients_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index 5274148..4dae296 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -40,6 +40,7 @@ class ClientsController < ApplicationController def find q = params[:q] json = Client.where('lower(first_name) LIKE ? OR lower(last_name) LIKE ? OR mobile_number = ?', q.downcase + '%', q.downcase+ '%', q) + .limit(10) .select(:uuid, :first_name, :last_name, :mobile_number) .as_json |
