method

encode_with

rails latest stable - Class: ActiveRecord::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

encode_with(coder)
public

Populate coder with attributes about this record that should be serialized. The structure of coder defined in this method is guaranteed to match the structure of coder passed to the init_with method.

Example:

class Post < ActiveRecord::Base
end
coder = {}
Post.new.encode_with(coder)
coder # => { 'id' => nil, ... }