aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-06-24 12:45:03 -0400
committerJon Moss <me@jonathanmoss.me>2016-06-24 12:45:03 -0400
commit7b86ea6715ee987e61a7f3bd8e72b1bbfcfbbbe7 (patch)
tree66c6dce18aa48ab61c1e9272626262f68601e42d /activerecord
parent382704987223754f0ede7fc1e327e44531a77f43 (diff)
downloadrails-7b86ea6715ee987e61a7f3bd8e72b1bbfcfbbbe7.tar.gz
rails-7b86ea6715ee987e61a7f3bd8e72b1bbfcfbbbe7.tar.bz2
rails-7b86ea6715ee987e61a7f3bd8e72b1bbfcfbbbe7.zip
Revert "[ci skip] better docs for ActiveRecord::AttributeSet::YAMLEncoder#decode"
This reverts commit 7ea502ae141fc26b736c7a73bdf7a676b1f9fc87, per internal discussion with @sgrif -- this is documenting the implementation of a class that isn't intended to be public API.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_set/yaml_encoder.rb17
1 files changed, 0 insertions, 17 deletions
diff --git a/activerecord/lib/active_record/attribute_set/yaml_encoder.rb b/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
index fd063555ec..6208048231 100644
--- a/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
+++ b/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
@@ -7,11 +7,6 @@ module ActiveRecord
@default_types = default_types
end
- # Populate +coder+ with 'concise_attributes' using +attribute_set+.
- #
- # If any attribute's name matches a +default_types+ key, then the
- # attribute will be cast by passing +nil+ to
- # ActiveRecord::Attribute#with_type.
def encode(attribute_set, coder)
coder['concise_attributes'] = attribute_set.each_value.map do |attr|
if attr.type.equal?(default_types[attr.name])
@@ -22,18 +17,6 @@ module ActiveRecord
end
end
- # Decode a previously encoded +coder+.
- #
- # +coder+ should be the result of previously encoding an Active Record
- # model, using #encode.
- #
- # If +coder+ contains an 'attributes' key, then #decode returns the value
- # under the 'attributes' key.
- #
- # Otherwise, #decode will build an attributes hash from the provided coder,
- # using its value under 'concise_attributes', while casting any nil types
- # using default_types. The resulting hash is used to return a new
- # ActiveRecord::AttributeSet.
def decode(coder)
if coder['attributes']
coder['attributes']