Sha256: f1112b99eaf3eebe6336414f32825c66e4cd0c0a600701a6fd222b6f1006d880

Contents?: true

Size: 815 Bytes

Versions: 102

Compression:

Stored size: 815 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Errors

    # This error is raised when an invalid value is passed to an eager
    # loading query.
    class InvalidIncludes < MongoidError

      # Initialize the error.
      #
      # @example Initialize the error.
      #   InvalidIncludes.new(Band, [ :members ])
      #
      # @param [ Class ] klass The model class.
      # @param [ Array<Object> ] args The arguments passed to the includes.
      #
      # @since 3.0.2
      def initialize(klass, args)
        super(
          compose_message(
            "invalid_includes",
            {
              klass: klass.name,
              args: args.map(&:inspect).join(", "),
              relations: klass.relations.keys.map(&:inspect).join(", ")
            }
          )
        )
      end
    end
  end
end

Version data entries

102 entries across 97 versions & 7 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.12 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.8 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.11 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.10 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.7 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.5 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.8 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.7 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.6 lib/mongoid/errors/invalid_includes.rb
mongoid-5.4.1 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.5 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.4 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.4 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.3 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.2 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.2 lib/mongoid/errors/invalid_includes.rb
mongoid-7.0.1 lib/mongoid/errors/invalid_includes.rb
mongoid-6.4.1 lib/mongoid/errors/invalid_includes.rb
mongoid-5.4.0 lib/mongoid/errors/invalid_includes.rb