Revision 1438:96973aaacd75 plugins/redmine_bibliography/app/controllers
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 82 | 82 |
def edit |
| 83 | 83 |
find_project_by_project_id unless params[:project_id].nil? |
| 84 | 84 |
|
| 85 |
@edit_view = true; |
|
| 86 | 85 |
@publication = Publication.find(params[:id]) |
| 87 | 86 |
@selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type |
| 88 |
|
|
| 89 | 87 |
@bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) |
| 90 | 88 |
end |
| 91 | 89 |
|
| ... | ... | |
| 202 | 200 |
object_id = params[:object_id] |
| 203 | 201 |
@object_name = "publications[authorships_attributes][#{object_id}][search_results]"
|
| 204 | 202 |
|
| 205 |
# cc 20110909 -- revert to like instead of like_unique -- see #289 |
|
| 206 |
authorships_list = Authorship.like(params[:term]).group('author_id').find(:all, :limit => 100)
|
|
| 207 |
|
|
| 208 |
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
|
|
| 209 | 205 |
|
| 210 | 206 |
users_list = User.active.like(params[:term]).find(:all, :limit => 100) |
| 211 | 207 |
|
Also available in: Unified diff