-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add rule 'rails_migrations_pending' #1210
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
Conversation
scorphus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
Please consider my sugestion below.
Co-authored-by: Pablo Aguiar <[email protected]>
| (Command("", output_env_development), "rails db:migrate RAILS_ENV=development"), | ||
| (Command("", output_env_test), "bin/rails db:migrate RAILS_ENV=test"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing it again, I thought that the corrected command could include the one initially intended by the user.
| (Command("", output_env_development), "rails db:migrate RAILS_ENV=development"), | |
| (Command("", output_env_test), "bin/rails db:migrate RAILS_ENV=test"), | |
| (Command("bin/rspec", output_env_development), "rails db:migrate RAILS_ENV=development && bin/rspec"), | |
| (Command("bin/rspec", output_env_test), "bin/rails db:migrate RAILS_ENV=test && bin/rspec"), |
Make sure to use shell._and to join the commands together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done
scorphus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, @abraham-chan! Thanks for contributing! ![]()
Add rule to fix a common Rails issue when running tests.
Rails source code that generates the message: https://github.com/rails/rails/blob/main/activerecord/lib/active_record/migration.rb#L152
Example output on my console: