Skip to content

Commit

Permalink
fix alphabetical concept listing starting with special uppercase lett…
Browse files Browse the repository at this point in the history
…er (e.g. german umlauts), #355
  • Loading branch information
mjansing committed Apr 29, 2016
1 parent f440bab commit 426ce2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/concepts/alphabetical_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def index
.order("letter").map(&:letter)

if dataset = datasets.detect { |dataset| dataset.name == params[:dataset] }
@search_results = dataset.alphabetical_search(params[:prefix], I18n.locale) || []
query = params[:prefix].mb_chars.downcase.to_s
@search_results = dataset.alphabetical_search(query, I18n.locale) || []
@search_results = Kaminari.paginate_array(@search_results).page(params[:page])
else
@search_results = find_labelings
Expand All @@ -54,10 +55,12 @@ def index
protected

def find_labelings
query = params[:prefix].mb_chars.downcase.to_s

Iqvoc::Concept.pref_labeling_class.
concept_published.
concept_not_expired.
label_begins_with(params[:prefix]).
label_begins_with(query).
by_label_language(I18n.locale).
includes(:target).
order("LOWER(#{Label::Base.table_name}.value)").
Expand Down

0 comments on commit 426ce2c

Please sign in to comment.