Sha256: 7476369c9b383e3550404ad402523395184af9f89a5bd43e33590ae4189b712c
Contents?: true
Size: 694 Bytes
Versions: 9
Compression:
Stored size: 694 Bytes
Contents
module Praxis module Extensions module FieldExpansion extend ActiveSupport::Concern included do Praxis::ActionDefinition.send(:include, ActionDefinitionExtension) end def expanded_fields @expansion ||= request.action.expanded_fields(self.request, self.media_type) end module ActionDefinitionExtension extend ActiveSupport::Concern def expanded_fields(request, media_type) uses_fields = self.params && self.params.attributes.key?(:fields) fields = uses_fields ? request.params.fields.fields : true Praxis::FieldExpander.expand(media_type,fields) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems