Mercurial > hg > soundsoftware-site
diff plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 1441:8d721cac2925 biblio_alt_search_auth
Addresses Bug #763 - patched the User class adding a new scope (name_like), that doesn't use the email address to search for a user.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 11 Oct 2013 13:49:02 +0100 |
parents | ee598c21c239 |
children |
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Oct 10 19:42:43 2013 +0100 +++ b/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Oct 11 13:49:02 2013 +0100 @@ -203,7 +203,8 @@ # todo: make sure query works with both pgres and mysql ~lf.20131010 authors_list = Author.joins(:authorships).where("LOWER(authorships.name_on_paper) LIKE LOWER(?)", "%#{params[:term]}%").uniq - users_list = User.active.like(params[:term]).find(:all, :limit => 100) + # name_like scope, defined in lib/user_author patch + users_list = User.active.name_like(params[:term]).find(:all, :limit => 100) logger.debug "Query for \"#{params[:term]}\" returned \"#{authors_list.size}\" authors and \"#{users_list.size}\" users"