Sha256: 987d6e4b9bc308a48bb5a7b2be4919b4c40971c3d7cce43833d69e5b21759fd8

Contents?: true

Size: 550 Bytes

Versions: 4

Compression:

Stored size: 550 Bytes

Contents

require "pluck_map/structured_attribute"

module PluckMap
  module Relationships
    class Base < StructuredAttribute
      attr_reader :scope

      def initialize(attribute_name, scope, block, options)
        @scope = scope
        @scope = @scope.instance_exec(&options[:scope_block]) if options[:scope_block]
        super(attribute_name, scope.klass, block, options)
      end

    protected

      def build_select
        raise NotImplementedError
      end

      def build_map
        raise NotImplementedError
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pluck_map-2.0.0 lib/pluck_map/relationships/base.rb
pluck_map-2.0.0.rc1 lib/pluck_map/relationships/base.rb
pluck_map-1.0.0 lib/pluck_map/relationships/base.rb
pluck_map-1.0.0.rc2 lib/pluck_map/relationships/base.rb