Created
November 26, 2010 23:11
-
-
Save laurynas/717328 to your computer and use it in GitHub Desktop.
Allow setting hash values for Globalize3 (hash keys - locale codes)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Globalize | |
module ActiveRecord | |
class Adapter | |
def write_with_hash(locale, name, value) | |
if value.is_a?(Hash) | |
value.each do |locale, value| | |
self.write_without_hash(locale, name, value) | |
end | |
else | |
self.write_without_hash(locale, name, value) | |
end | |
end | |
alias_method_chain :write, :hash | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment