Split Poll::Booth.search in two methods
We use this method in two different scenarios. In an AJAX request, we don't want to return every booth if the search is blank. However, in a normal HTTP GET request, we want to return every record when the search is empty, as we do everywhere else. It's possible the behaviour of the AJAX call is unusual, since it searches all booths, and not just the ones assigned to a poll. If we changed this behaviour, we could simplify the code and remove the `quick_search` method.
This commit is contained in:
@@ -9,7 +9,7 @@ class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
|
||||
|
||||
def search_booths
|
||||
load_search
|
||||
@booths = ::Poll::Booth.search(@search)
|
||||
@booths = ::Poll::Booth.quick_search(@search)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user