Skip to content

Commit

Permalink
Revert "Correct people sort order in Ukrainian. Fixes #148"
Browse files Browse the repository at this point in the history
This reverts commit cceba4b.

Simply transliterating the strings doesn't correctly sort it in the
localised language - it just sorts it from an English perspective.
  • Loading branch information
henare committed Dec 8, 2015
1 parent d007929 commit e3b0dd0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def index

@members = case @sort
when "constituency"
members.sort_by { |m| [I18n.transliterate(m.constituency), I18n.transliterate(m.last_name), I18n.transliterate(m.first_name), I18n.transliterate(m.party), -m.entered_house.to_time.to_i] }
members.sort_by { |m| [m.constituency, m.last_name, m.first_name, m.party, -m.entered_house.to_time.to_i] }
when "party"
members.sort_by { |m| [I18n.transliterate(m.party), I18n.transliterate(m.last_name), I18n.transliterate(m.first_name), I18n.transliterate(m.constituency), -m.entered_house.to_time.to_i] }
members.sort_by { |m| [m.party, m.last_name, m.first_name, m.constituency, -m.entered_house.to_time.to_i] }
when "rebellions"
members.sort_by { |m| [-(m.person.rebellions_fraction || -1), I18n.transliterate(m.last_name), I18n.transliterate(m.first_name), I18n.transliterate(m.constituency), I18n.transliterate(m.party), -m.entered_house.to_time.to_i] }
members.sort_by { |m| [-(m.person.rebellions_fraction || -1), m.last_name, m.first_name, m.constituency, m.party, -m.entered_house.to_time.to_i] }
when "attendance"
members.sort_by { |m| [-(m.person.attendance_fraction || -1), I18n.transliterate(m.last_name), I18n.transliterate(m.first_name), I18n.transliterate(m.constituency), I18n.transliterate(m.party), -m.entered_house.to_time.to_i] }
members.sort_by { |m| [-(m.person.attendance_fraction || -1), m.last_name, m.first_name, m.constituency, m.party, -m.entered_house.to_time.to_i] }
else
members.sort_by { |m| [I18n.transliterate(m.last_name), I18n.transliterate(m.first_name), I18n.transliterate(m.constituency), I18n.transliterate(m.party), -m.entered_house.to_time.to_i] }
members.sort_by { |m| [m.last_name, m.first_name, m.constituency, m.party, -m.entered_house.to_time.to_i] }
end
end

Expand Down

0 comments on commit e3b0dd0

Please sign in to comment.