Sha256: e4e93241cdbc64a2feed031cdba07fafb7242b2084a5d356f50d8525b5ff7131

Contents?: true

Size: 550 Bytes

Versions: 5

Compression:

Stored size: 550 Bytes

Contents

module Ardm::Dm
  module RelationChain
    extend ActiveSupport::Concern

    included do
      alias_method :old_delegate_to_relationship, :delegate_to_relationship
    end

    def delegate_to_relationship(relationship, query = nil)
      Ardm::Deprecation.warn("Relation chain #{model.name}.#{relationship.name}")
      old_delegate_to_relationship(relationship, query)
    end

    def includes(*)
      self
    end

    def references(*)
      self
    end
  end
end

DataMapper::Collection.class_eval do
  include Ardm::Dm::RelationChain
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ardm-0.4.0.ar427 lib/ardm/dm/collection.rb
ardm-0.4.0 lib/ardm/dm/collection.rb
ardm-0.3.2 lib/ardm/dm/collection.rb
ardm-0.3.1 lib/ardm/dm/collection.rb
ardm-0.3.0 lib/ardm/dm/collection.rb