Skip to content

Instantly share code, notes, and snippets.

@laurynas
Created November 26, 2010 23:11
Show Gist options
  • Save laurynas/717328 to your computer and use it in GitHub Desktop.
Save laurynas/717328 to your computer and use it in GitHub Desktop.
Allow setting hash values for Globalize3 (hash keys - locale codes)
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