DatabaseCleaner/database_cleaner · error · ArgumentError

No options are available for the #{name} strategy.

Error message

No options are available for the #{name} strategy.

What it means

Error "No options are available for the #{name} strategy." thrown in DatabaseCleaner/database_cleaner.

Source

Thrown at lib/database_cleaner/strategy.rb:9

# Abstract strategy class for orm adapter gems to subclass

module DatabaseCleaner
  class Strategy
    # Override this method if the strategy accepts options
    def initialize(options=nil)
      if options
        name = self.class.name.sub("DatabaseCleaner::","").sub("::"," ") # e.g. "ActiveRecord Transaction"
        raise ArgumentError, "No options are available for the #{name} strategy."
      end
    end

    def db
      @db ||= :default
    end
    attr_writer :db

    # Override this method to start a database transaction if the strategy uses them
    def start
    end

    # Override this method with the actual cleaning procedure. Its the only mandatory method implementation.
    def clean
      raise NotImplementedError
    end

    def cleaning(&block)

View on GitHub (pinned to 09b47d03cc)

When it happens

Trigger: Thrown at lib/database_cleaner/strategy.rb:9 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DatabaseCleaner/database_cleaner@09b47d03cc (2026-08-23). Data as JSON: /api/errors/3de2cd916a9c5e8b. Report an issue: GitHub.