Module: ActiveRecord::LegacyYamlAdapter

Defined in:
activerecord/lib/active_record/legacy_yaml_adapter.rb

Defined Under Namespace

Modules: Rails41

Class Method Summary collapse

Class Method Details

.convert(klass, coder) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'activerecord/lib/active_record/legacy_yaml_adapter.rb', line 3

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

  case coder["active_record_yaml_version"]
  when 0 then coder
  else
    if coder["attributes"].is_a?(AttributeSet)
      coder
    else
      Rails41.convert(klass, coder)
    end
  end
end