From ba2aa1fdfdaf2998fbfb0208c9246c82583a8c3e Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Sun, 23 Apr 2017 14:18:09 -0500 Subject: [PATCH] Remove dead comments --- lib/active_model/serializer.rb | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/lib/active_model/serializer.rb b/lib/active_model/serializer.rb index c7664258..5de2ae24 100644 --- a/lib/active_model/serializer.rb +++ b/lib/active_model/serializer.rb @@ -349,31 +349,6 @@ module ActiveModel # @return [Hash] containing the attributes and first level # associations, similar to how ActiveModel::Serializers::JSON is used # in ActiveRecord::Base. - # - # TODO: Include ActiveModel::Serializers::JSON. - # So that the below is true: - # @param options [nil, Hash] The same valid options passed to `serializable_hash` - # (:only, :except, :methods, and :include). - # - # See - # https://github.com/rails/rails/blob/v5.0.0.beta2/activemodel/lib/active_model/serializers/json.rb#L17-L101 - # https://github.com/rails/rails/blob/v5.0.0.beta2/activemodel/lib/active_model/serialization.rb#L85-L123 - # https://github.com/rails/rails/blob/v5.0.0.beta2/activerecord/lib/active_record/serialization.rb#L11-L17 - # https://github.com/rails/rails/blob/v5.0.0.beta2/activesupport/lib/active_support/core_ext/object/json.rb#L147-L162 - # - # @example - # # The :only and :except options can be used to limit the attributes included, and work - # # similar to the attributes method. - # serializer.as_json(only: [:id, :name]) - # serializer.as_json(except: [:id, :created_at, :age]) - # - # # To include the result of some method calls on the model use :methods: - # serializer.as_json(methods: :permalink) - # - # # To include associations use :include: - # serializer.as_json(include: :posts) - # # Second level and higher order associations work as well: - # serializer.as_json(include: { posts: { include: { comments: { only: :body } }, only: :title } }) def serializable_hash(adapter_options = nil, options = {}, adapter_instance = self.class.serialization_adapter_instance) adapter_options ||= {} options[:include_directive] ||= ActiveModel::Serializer.include_directive_from_options(adapter_options) @@ -385,13 +360,6 @@ module ActiveModel alias to_h serializable_hash # @see #serializable_hash - # TODO: When moving attributes adapter logic here, @see #serializable_hash - # So that the below is true: - # @param options [nil, Hash] The same valid options passed to `as_json` - # (:root, :only, :except, :methods, and :include). - # The default for `root` is nil. - # The default value for include_root is false. You can change it to true if the given - # JSON string includes a single root node. def as_json(adapter_opts = nil) serializable_hash(adapter_opts) end