# HG changeset patch # User luisf # Date 1381435901 -3600 # Node ID 31de8828252ac6f977afebaccebeb71f447981c3 # Parent d0ac3348d28df72e997182337cb940a5fa6fb1e3# Parent ee598c21c239b1e801c1d0b4a5def65c7f5463bd Merge diff -r d0ac3348d28d -r 31de8828252a plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Oct 09 19:17:47 2013 +0100 +++ b/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Oct 10 21:11:41 2013 +0100 @@ -200,10 +200,8 @@ object_id = params[:object_id] @object_name = "publications[authorships_attributes][#{object_id}][search_results]" - # cc 20110909 -- revert to like instead of like_unique -- see #289 - authorships_list = Authorship.like(params[:term]).group('author_id').find(:all, :limit => 100) - - authors_list = authorships_list.collect do |x| x.author end + # 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)