Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ def store_translations(locale, data, options = {}) | |
raise "Key-value stores cannot handle procs" | ||
end | ||
|
||
@store[key] = ActiveSupport::JSON.encode(value) unless value.is_a?(Symbol) | ||
@store[key] = ActiveSupport::JSON.encode([value]) unless value.is_a?(Symbol) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
end | ||
end | ||
|
||
|
@@ -90,7 +90,7 @@ def available_locales | |
def lookup(locale, key, scope = [], options = {}) | ||
key = normalize_flat_keys(locale, key, scope, options[:separator]) | ||
value = @store["#{locale}.#{key}"] | ||
value = ActiveSupport::JSON.decode(value) if value | ||
value = ActiveSupport::JSON.decode(value)[0] if value | ||
This comment has been minimized.
Sorry, something went wrong.
sashich
|
||
value.is_a?(Hash) ? value.deep_symbolize_keys : value | ||
end | ||
end | ||
|
Hmm.. I'd also like clarification on why this was done...
Doesn't this break subtree functionality? In
store_translations
, theold_value
will never be a Hash so thedeep_merge!
will never be performed.