Sha256: 928284772bcc30a578fb7c20b14ef8c02c53bf313a7a7fc81723cb307871d146

Contents?: true

Size: 517 Bytes

Versions: 18

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

module GraphqlDevise
  module MountMethod
    module OptionValidators
      class SkipOnlyValidator
        def initialize(options:)
          @options = options
        end

        def validate!
          if [@options.skip, @options.only].all?(&:present?)
            raise(
              GraphqlDevise::InvalidMountOptionsError,
              "Can't specify both `skip` and `only` options when mounting the route."
            )
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
graphql_devise-0.18.2 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.18.1 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.18.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.17.1 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.17.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.16.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.15.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.14.3 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.14.2 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.14.1 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.14.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.6 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.5 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.4 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.3 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.2 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.1 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
graphql_devise-0.13.0 lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb