Module: Praxis::Extensions::FieldExpansion::ActionDefinitionExtension

Extended by:
ActiveSupport::Concern
Defined in:
lib/praxis/extensions/field_expansion.rb

Instance Method Summary collapse

Instance Method Details

#expanded_fields(request, media_type, expansion_filter) ⇒ Object



23
24
25
26
27
# File 'lib/praxis/extensions/field_expansion.rb', line 23

def expanded_fields(request, media_type, expansion_filter)
  uses_fields = params&.attributes&.key?(:fields)
  fields = uses_fields ? request.params.fields.fields : true
  Praxis::FieldExpander.expand(media_type, fields, expansion_filter)
end