def init_with(coder, &block)
      coder = LegacyYamlAdapter.convert(self.class, coder)
      attributes = self.class.yaml_encoder.decode(coder)
      init_with_attributes(attributes, coder["new_record"], &block)
    end
def init_with(coder, &block)
      coder = LegacyYamlAdapter.convert(self.class, coder)
      attributes = self.class.yaml_encoder.decode(coder)
      init_with_attributes(attributes, coder["new_record"], &block)
    end
New objects can be instantiated as either empty (pass no construction parameter) or pre-set with
 attributes but not yet saved (pass a hash with key names matching the associated table column names).
 In both instances, valid attribute keys are determined by the column names of the associated table --
 hence you can't have attributes that aren't part of the table columns.

 ==== Example:
   # Instantiates a single new object
   User.new(first_name: 'Jamie')
 Initialize an empty model object from +coder+. +coder+ should be
 the result of previously encoding an Active Record model, using
 #encode_with.

   class Post < ActiveRecord::Base
   end

   old_post = Post.new(title: "hello world")
   coder = {}
   old_post.encode_with(coder)

   post = Post.allocate
   post.init_with(coder)
   post.title # => 'hello world'