Skip to content

Conversation

@dgarwood
Copy link
Contributor

@dgarwood dgarwood commented Jan 21, 2025

This change takes a different approach to checking migrations on the app being checked by ok_computer by using the ActiveRecord::Migration.check_pending! or .check_all_pending! methods and properly handling the ActiveRecord::PendingMigrationError that could be returned.

This also includes checks that display an info message when rails is configured to check migrations on page load. The main change here is that OkComputer no longer fails this check for different versions of ActiveRecord.

Need to refactor tests.

fixes #11

@dgarwood dgarwood marked this pull request as ready for review January 21, 2025 21:52
@dgarwood
Copy link
Contributor Author

@rmm5t I'm interested in your feedback on this as well, since it looks like you did some work on this check in the past.

Copy link
Owner

@emmahsax emmahsax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this looks great to me! Thanks @dgarwood! If @rmm5t also thinks it looks good, I'm all set to merge!

Also, if you'd like to choose what text to add to the CHANGELOG.markdown, you can add it in this PR. Something like this to lines 2-3 (but feel free to change the description text):

* Update ActiveRecordMigrationsCheck to use public active_record methods and errors
  > dgarwood: https://github.com/emmahsax/okcomputer/pull/14

In a few days, if I don't hear back, I'll just merge the PR and update the file with that above text after merge.

@emmahsax emmahsax changed the title update migration check to use public active_record menthods and errors update migration check to use public active_record methods and errors Feb 6, 2025
@dgarwood
Copy link
Contributor Author

dgarwood commented Feb 8, 2025

@emmahsax what you have for changelog looks good to me.

@emmahsax emmahsax requested a review from rmm5t February 10, 2025 22:44
@emmahsax emmahsax merged commit 60f08ca into emmahsax:main Feb 11, 2025
62 checks passed
@emmahsax
Copy link
Owner

v1.19.0 has officially been released with this change!

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.

Built-in ActiveRecordMigrationsCheck fails in Rails 7.2+

3 participants