Skip to content

Conversation

@justindell
Copy link
Contributor

See rails/rails#54879.

I believe with Rails 8.1 ActiveRecord::Task classes are expected to subclass AbstractTasks.

I was seeing failures running tests on my rails app due to "NoMethodError: undefined method 'check_current_protected_environment!' for an instance of ActiveRecord::Tasks::SQLServerDatabaseTasks (NoMethodError)". This is because the check_current_protected_environment! method was moved to the AbstractTasks class.

With this change, the task db:check_protected_environments should work again.

@aidanharan
Copy link
Contributor

Could you add an entry to 'CHANGELOG.md'?

@justindell
Copy link
Contributor Author

Done!

ttilberg added a commit to ttilberg/activerecord-sqlserver-adapter that referenced this pull request Nov 11, 2025
Keeping my own fork so the branch stays stable after it's merged.
@aidanharan aidanharan changed the title make SQLServerDatabaseTasks a subclass of AbstractTasks Fixed SQL Server database tasks Nov 12, 2025
@aidanharan aidanharan merged commit 77ed1c7 into rails-sqlserver:8-1-stable Nov 12, 2025
1 check was pending
@aidanharan
Copy link
Contributor

@justindell Thanks for the PR!

Ref: rails/rails#54879

aidanharan pushed a commit that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants