Skip to content
Snippets Groups Projects
Commit 7f83f8d8 authored by pabois's avatar pabois
Browse files

close #344

parent cc38b449
No related branches found
No related tags found
No related merge requests found
...@@ -138,6 +138,10 @@ class University::Person < ApplicationRecord ...@@ -138,6 +138,10 @@ class University::Person < ApplicationRecord
"#{first_name} #{last_name}" "#{first_name} #{last_name}"
end end
def to_s_alphabetical
"#{last_name} #{first_name}"
end
def roles def roles
LIST_OF_ROLES.reject do |role| LIST_OF_ROLES.reject do |role|
! send "is_#{role}" ! send "is_#{role}"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<% if current_user.author? || current_user.contributor? %> <% if current_user.author? || current_user.contributor? %>
<%= f.input :author_id, as: :hidden, input_html: { value: current_user.person&.id }, wrapper: false %> <%= f.input :author_id, as: :hidden, input_html: { value: current_user.person&.id }, wrapper: false %>
<% else %> <% else %>
<%= f.association :author, collection: current_university.people.ordered %> <%= f.association :author, collection: current_university.people.ordered, label_method: :to_s_alphabetical %>
<% end %> <% end %>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment