instance method
encode_with
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.2.22.5Available in: v3.1.12 v3.2.22.5
Signature
encode_with(coder)
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, ... }
Parameters
-
coderreq
Source
# File activerecord/lib/active_record/base.rb, line 1596
def encode_with(coder)
coder['attributes'] = attributes
end
Defined in activerecord/lib/active_record/base.rb line 1596
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base