diff --git a/app/models/color.rb b/app/models/color.rb index 792dc21b..c73cd9b5 100644 --- a/app/models/color.rb +++ b/app/models/color.rb @@ -1,7 +1,7 @@ class Color < ActiveRecord::Base translates :name - scope :alphabetical, lambda { includes(:translations).order(Color::Translation.arel_table[:name]) } + scope :alphabetical, lambda { with_translations(I18n.locale).order(Color::Translation.arel_table[:name]) } scope :basic, where(:basic => true) scope :standard, where(:standard => true) scope :nonstandard, where(:standard => false) diff --git a/app/models/species.rb b/app/models/species.rb index ac3b4f4e..71922dc7 100644 --- a/app/models/species.rb +++ b/app/models/species.rb @@ -1,7 +1,7 @@ class Species < ActiveRecord::Base translates :name - scope :alphabetical, lambda { includes(:translations).order(Species::Translation.arel_table[:name]) } + scope :alphabetical, lambda { with_translations(I18n.locale).order(Species::Translation.arel_table[:name]) } def as_json(options={}) {:id => id, :name => human_name} diff --git a/app/models/zone.rb b/app/models/zone.rb index 83ec6c2e..c149156c 100644 --- a/app/models/zone.rb +++ b/app/models/zone.rb @@ -6,7 +6,7 @@ class Zone < ActiveRecord::Base attr_writer :sometimes scope :alphabetical, lambda { - includes_translations.order(Zone::Translation.arel_table[:label]) + with_translations(I18n.locale).order(Zone::Translation.arel_table[:label]) } scope :includes_translations, lambda { includes(:translations) } scope :with_plain_label, lambda { |label|