123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::LegacyYamlAdapter

Relationships & Source Files
Namespace Children
Modules:
Defined in: activerecord/lib/active_record/legacy_yaml_adapter.rb

Class Method Summary

Class Method Details

.convert(klass, coder)

[ GitHub ]

  
# File 'activerecord/lib/active_record/legacy_yaml_adapter.rb', line 5

def self.convert(klass, coder)
  return coder unless coder.is_a?(Psych::Coder)

  case coder["active_record_yaml_version"]
  when 1, 2 then coder
  else
    if coder["attributes"].is_a?(ActiveModel::AttributeSet)
      Rails420.convert(klass, coder)
    else
      Rails41.convert(klass, coder)
    end
  end
end