Improvements from Rails plugin template

This commit is contained in:
Benjamin Fleischer
2016-04-01 04:12:30 -05:00
parent 96c5516d21
commit 21b2eff2ab
11 changed files with 61 additions and 19 deletions

View File

@@ -2,16 +2,15 @@ module ActiveModel
class Serializer
# This class hold all information about serializer's association.
#
# @param [Symbol] name
# @param [ActiveModel::Serializer] serializer
# @param [Hash{Symbol => Object}] options
# @attr [Symbol] name
# @attr [ActiveModel::Serializer] serializer
# @attr [Hash{Symbol => Object}] options
#
# @example
# Association.new(:comments, CommentSummarySerializer)
#
Association = Struct.new(:name, :serializer, :options, :links, :meta) do
# @return [Symbol]
#
def key
options.fetch(:key, name)
end

View File

@@ -74,7 +74,7 @@ module ActiveModel
# Sets +::_cache+ object to <tt>ActionController::Base.cache_store</tt>
# when Rails.configuration.action_controller.perform_caching
#
# @params options [Hash] with valid keys:
# @param options [Hash] with valid keys:
# cache_store : @see ::_cache
# key : @see ::_cache_key
# only : @see ::_cache_only