Sha256: 5f420e23c8f55e5720530f3c87ccefc8186f4c286d9f90b60de670e6253c089f

Contents?: true

Size: 599 Bytes

Versions: 1

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

require_relative "core"

module ROM
  module Components
    module DSL
      # @private
      class Dataset < Core
        key :datasets

        def configure
          if relation?
            config.join!({namespace: relation_id}, :right) if config.id != relation_id

            config.relation_id = relation_id
          end
          super
        end

        private

        def relation_id
          provider.config.component.id
        end

        def relation?
          provider.config.component.type == :relation
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-6.0.0.alpha1 lib/rom/components/dsl/dataset.rb