Module: ActiveRecord::AttributeMethods::Serialization::ClassMethods
- Defined in:
- lib/patches/active_record/serialization.rb
Instance Method Summary collapse
Instance Method Details
#serialize_with_globalize(attr_name, class_name_or_coder = Object) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/patches/active_record/serialization.rb', line 7 def serialize_with_globalize(attr_name, class_name_or_coder = Object) serialize_without_globalize(attr_name, class_name_or_coder) coder = if class_name_or_coder == ::JSON Coders::JSON elsif [:load, :dump].all? { |x| class_name_or_coder.respond_to?(x) } class_name_or_coder else Coders::YAMLColumn.new(class_name_or_coder) end self.globalize_serialized_attributes[attr_name] = coder end |