Sha256: 604dfc3cb617d16e7704043e5cae76b484cf4bb98da23b0024babff0937d1dcb

Contents?: true

Size: 761 Bytes

Versions: 188

Compression:

Stored size: 761 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc
  module Errors #:nodoc

    # Raised when invalid options are passed to a relation macro.
    class InvalidOptions < MongoidError

      # Instantiate the options error.
      #
      # @example Create the error.
      #   InvalidOptions.new(:name, :polymorphic, [ :as ])
      #
      # @param [ Symbol ] name The name of the relation.
      # @param [ Symbol ] invalid The invalid option.
      # @param [ Array<Symbol> ] valid The allowed options.
      #
      # @since 2.1.0
      def initialize(name, invalid, valid)
        super(
          translate(
            "invalid_options",
            { :name => name, :invalid => invalid, :valid => valid.join(', ') }
          )
        )
      end
    end
  end
end

Version data entries

188 entries across 96 versions & 4 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
mongoid-2.8.1 lib/mongoid/errors/invalid_options.rb
mongoid-2.8.0 lib/mongoid/errors/invalid_options.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_options.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_options.rb