Skip to content

Commit

Permalink
Fix the searching on admin names and don't search on auth tokens.
Browse files Browse the repository at this point in the history
The "first_name" and "last_name" columns don't exist on the admin
collection, so this was actually just supposed to search on the "name"
column.

And I'm not sure why we really exposed searching on auth tokens, but
this doesn't seem necessary.
  • Loading branch information
GUI committed Jul 13, 2017
1 parent 6fac759 commit aac482e
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ def index

if(params["search"] && params["search"]["value"].present?)
@admins = @admins.or([
{ :first_name => /#{Regexp.escape(params["search"]["value"])}/i },
{ :last_name => /#{Regexp.escape(params["search"]["value"])}/i },
{ :name => /#{Regexp.escape(params["search"]["value"])}/i },
{ :email => /#{Regexp.escape(params["search"]["value"])}/i },
{ :username => /#{Regexp.escape(params["search"]["value"])}/i },
{ :authentication_token => /#{Regexp.escape(params["search"]["value"])}/i },
{ :_id => params[:search][:value].downcase },
])
end
Expand Down

0 comments on commit aac482e

Please sign in to comment.