We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to run 'rake spec' while using nulldb I get this error:
$ rake spec Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=test
Environment:
ruby 2.6.6 (linux) rails (5.2.4.3) rspec-rails (4.0.1) activerecord (5.2.4.3) activerecord-nulldb-adapter (0.4.0)
database.yml defines
test: adapter: nulldb
Adding this to the end of config/environments/test.rb fixes the problem and allows the specs to run:
config/environments/test.rb
module ActiveRecord class MigrationContext def needs_migration? false end end end
The text was updated successfully, but these errors were encountered:
I also ran into this. A more flexible patch is:
module NullDBMigrationContextPatch def needs_migration? return false if schema_migration.connection.adapter_name == 'NullDB' super end end class ActiveRecord::MigrationContext prepend NullDBMigrationContextPatch end
Sorry, something went wrong.
That is very slick! Thanks!
Leaving this as pinned but closing for now.
No branches or pull requests
ERROR
Trying to run 'rake spec' while using nulldb I get this error:
CONFIGURATION
Environment:
database.yml defines
WORKAROUND
Adding this to the end of
config/environments/test.rb
fixes the problem and allows the specs to run:The text was updated successfully, but these errors were encountered: