Sha256: 3dc4d4af4ab2476e250ff38e5c34c029b53c653822ac0768ed95da038b1076e6

Contents?: true

Size: 861 Bytes

Versions: 16

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  module Errors

    # Raised when an option provided for an association is invalid.
    class InvalidRelationOption < MongoidError

      # Create the new error.
      #
      # @example Create the new error.
      #   InvalidRelationOption.new(Person, invalid_option: 'make_me_a_sandwich')
      #
      # @param [ Class ] klass The model class.
      # @param [ String | Symbol ] name The association name.
      # @param [ Symbol ] option The invalid option.
      # @param [ Array<Symbol> ] valid_options The valid option.
      def initialize(klass, name, option, valid_options)
        super(
            compose_message(
                "invalid_relation_option",
                { klass: klass, name: name, option: option, valid_options: valid_options }
            )
        )
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mongoid-8.1.8 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.7 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.6 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.8 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.5 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.4 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.7 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.3 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.2 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.6 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.1 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.5 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.1.0 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.4 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.3 lib/mongoid/errors/invalid_relation_option.rb
mongoid-8.0.2 lib/mongoid/errors/invalid_relation_option.rb