method

encode_with

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveRecord::Base
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, ... }
Show source
Register or log in to add new notes.