From ea6112a9bc44043600ad3a6d68c4311a56acc651 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 19 Nov 2015 09:06:12 +0100 Subject: [PATCH] To increase tests, added possibility to set used locales via env vars. --- app/models/locale.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/locale.rb b/app/models/locale.rb index fb7981dd6..e295da923 100644 --- a/app/models/locale.rb +++ b/app/models/locale.rb @@ -7,6 +7,11 @@ class Locale < ApplicationModel if Rails.env.test? locales = Locale.where(active: true, locale: ['en-us', 'de-de']) end + + # read used locales based on env, e. g. export Z_LOCALES='en-us:de-de' + if ENV['Z_LOCALES'] + locales = Locale.where(active: true, locale: ENV['Z_LOCALES'].split(':') ) + end locales end