# HG changeset patch # User luisf # Date 1381430563 -3600 # Node ID ee598c21c239b1e801c1d0b4a5def65c7f5463bd # Parent a9cfc6dcfb8331242ad04c93d2c813c114598aae Changed query that was using group (breaking the development server): using uniq instead. diff -r a9cfc6dcfb83 -r ee598c21c239 plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Oct 09 19:17:22 2013 +0100 +++ b/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Oct 10 19:42:43 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)