diff options
-rw-r--r-- | lib/category_and_heading_migrator.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/category_and_heading_migrator.rb b/lib/category_and_heading_migrator.rb index 93b8fc3b2..7a7057887 100644 --- a/lib/category_and_heading_migrator.rb +++ b/lib/category_and_heading_migrator.rb @@ -59,8 +59,10 @@ module CategoryAndHeadingMigrator end def self.add_heading(name, locale, first_locale) - heading = PublicBodyHeading.with_translations.where(:name => name).first - + heading = nil + I18n.with_locale(locale) do + heading = PublicBodyHeading.find_by_name(name) + end # For multi-locale installs, we assume that all public_body_[locale].rb files # use the same headings in the same order, so we add translations to the heading # that was in the same position in the list loaded from other public_body_[locale].rb |