Sha256: d79324287ba4bdbe65962c624db77294ac3c7540fa95d598250d84c92339e250

Contents?: true

Size: 607 Bytes

Versions: 10

Compression:

Stored size: 607 Bytes

Contents

module Hanami
  module Model
    module Associations
      # Auto-infer relations linked to repository's associations
      #
      # @since 0.7.0
      # @api private
      class Dsl
        # @since 0.7.0
        # @api private
        def initialize(repository, &blk)
          @repository = repository
          instance_eval(&blk)
        end

        # @since 0.7.0
        # @api private
        def has_many(relation, *)
          @repository.__send__(:relations, relation)
        end

        # @since 0.7.0
        # @api private
        def belongs_to(*)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hanami-model-1.0.4 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.3 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.2 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.1 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.0 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.0.rc1 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.0.beta3 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.0.beta2 lib/hanami/model/associations/dsl.rb
hanami-model-1.0.0.beta1 lib/hanami/model/associations/dsl.rb
hanami-model-0.7.0 lib/hanami/model/associations/dsl.rb