mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Improvements from Rails plugin template
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user