Skip to content

Commit

Permalink
Sort users alphabetically. (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
arne-z authored and bdaase committed Feb 4, 2019
1 parent 2374acb commit b3aa382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def self.search(term, role)
if term
users = where('first_name LIKE ? or last_name LIKE ?', "%#{term}%", "%#{term}%")
users = users.where(role: role) if role && role != ''
users
users.order(last_name: :asc)
else
all
order(last_name: :asc)
end
end

Expand Down

0 comments on commit b3aa382

Please sign in to comment.