Sha256: 765a030afd0df686e23f0712134e5d98725ace39c04495f057c91cee2d8d64d9

Contents?: true

Size: 488 Bytes

Versions: 6

Compression:

Stored size: 488 Bytes

Contents

module Praxis
  module Extensions
    module MapperSelectors
      extend ActiveSupport::Concern
      include FieldExpansion

      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
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
praxis-0.22.pre.2 lib/praxis/extensions/mapper_selectors.rb
praxis-0.22.pre.1 lib/praxis/extensions/mapper_selectors.rb
praxis-0.21 lib/praxis/extensions/mapper_selectors.rb
praxis-0.20.1 lib/praxis/extensions/mapper_selectors.rb
praxis-0.20.0 lib/praxis/extensions/mapper_selectors.rb
praxis-0.19.0 lib/praxis/extensions/mapper_selectors.rb