Revision 1436:ee598c21c239 plugins/redmine_bibliography
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 200 | 200 |
object_id = params[:object_id] |
| 201 | 201 |
@object_name = "publications[authorships_attributes][#{object_id}][search_results]"
|
| 202 | 202 |
|
| 203 |
# cc 20110909 -- revert to like instead of like_unique -- see #289 |
|
| 204 |
authorships_list = Authorship.like(params[:term]).group('author_id').find(:all, :limit => 100)
|
|
| 205 |
|
|
| 206 |
authors_list = authorships_list.collect do |x| x.author end |
|
| 203 |
# todo: make sure query works with both pgres and mysql ~lf.20131010 |
|
| 204 |
authors_list = Author.joins(:authorships).where("LOWER(authorships.name_on_paper) LIKE LOWER(?)", "%#{params[:term]}%").uniq
|
|
| 207 | 205 |
|
| 208 | 206 |
users_list = User.active.like(params[:term]).find(:all, :limit => 100) |
| 209 | 207 |
|
Also available in: Unified diff