Allow different default locales per tenant
Note that, for everything to work consistently, we need to make sure that the default locale is one of the available locales. Also note that we aren't overwriting the `#save ` method set by globalize. I didn't feel too comfortable changing a monkey-patch which ideally shouldn't be there in the first place, I haven't found a case where `Globalize.locale` is `nil` (since it defaults to `I18n.locale`, which should never be `nil`), so using `I18n.default_locale` probably doesn't affect us.
This commit is contained in:
@@ -82,7 +82,7 @@ module Globalizable
|
||||
translation_class.instance_eval do
|
||||
validates method,
|
||||
length: options[:length],
|
||||
if: lambda { |translation| translation.locale == I18n.default_locale }
|
||||
if: lambda { |translation| translation.locale == Setting.default_locale }
|
||||
end
|
||||
if options.count > 1
|
||||
translation_class.instance_eval do
|
||||
|
||||
Reference in New Issue
Block a user