-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
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
Rails 6.0 - "Nothing to do" when running rake db:generate_trigger_migration #84
Comments
I'm also facing the same issue using hair_trigger with Rails 6. Migrations are not getting generated. |
@jainbasil Me too. I have taken to going to the Rails console and issuing a variant of @Owumaro's note above: Zeitwerk::Loader.eager_load_all
Rails.application.load_tasks
Rake::Task['db:generate_trigger_migration'].invoke It would be great for this gem to get a fix so I can go back to just using the rake task! |
Related to rails/rails#37006 |
Is this still an issue? Seems like a fix may have been merged to rails 6 stable here: rails/rails@3285f3d |
@jenseng Confirmed I can now generate migrations with the rake task in Rails 6.0.3.5, so I think you're right it's been fixed upstream. |
When I run
rake db:generate_trigger_migration
for my Rails 6.0 app I get "Nothing to do" even if I added triggers to a model.This is tied to this issue : rails/rails#37006
See https://github.com/ojab/hair_trigger/blob/rails-6/lib/hair_trigger.rb#L24
To get models, this gem runs
However it is not enough in Rails 6.0, you have to run
Zeitwerk::Loader.eager_load_all
to load all models before runningActiveRecord::Base.descendants
.Not sure if this gem should adapt itself or wait for a fix in Rails.
The text was updated successfully, but these errors were encountered: