def write_attribute(name, value, options = {})
if translated?(name)
unless options.is_a?(Hash)
warn "[DEPRECATION] passing 'locale' as #{options.inspect} is deprecated. Please use {:locale => #{options.inspect}} instead."
options = {:locale => options}
end
options = {:locale => Globalize.locale}.merge(options)
name_str = name.to_s
if attribute_changed?(name_str)
old = changed_attributes[name_str]
changed_attributes.delete(name_str) if value == old
else
old = globalize.fetch(options[:locale], name)
old = old.clone if old.duplicable?
changed_attributes[name_str] = old if value != old
end
globalize.write(options[:locale], name, value)
else
super(name, value)
end
end