module Praxis::Extensions::MapperSelectors

Public Instance Methods

set_selectors() click to toggle source
# File lib/praxis/extensions/mapper_selectors.rb, line 7
def set_selectors
  return unless self.media_type.respond_to?(:domain_model) &&
    self.media_type.domain_model < Praxis::Mapper::Resource

  resolved = Praxis::MediaType::FieldResolver.resolve(self.media_type, self.expanded_fields)
  identity_map.add_selectors(self.media_type.domain_model, resolved)
end