Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Feature: Re-generate model RBIs on db:migrate #411

Open
bmulholland opened this issue May 4, 2021 · 2 comments
Open

Feature: Re-generate model RBIs on db:migrate #411

bmulholland opened this issue May 4, 2021 · 2 comments

Comments

@bmulholland
Copy link

It would be nice if the RBIs were auto-updated as a hook when db:migrate is run. Here's an example of how another project does that: https://github.com/ctran/annotate_models/blob/develop/lib/tasks/annotate_models_migrate.rake

@hdoan741
Copy link
Contributor

I've tried building something like that before. I think it was a bit slow to run as part of db migration. It is an incomplete solution, since it doesn't cover RBI changes when someone update a model.

An alternative is to enforce that generated files don't change in CI. We've done that in our team and it can help making sure gem RBI, model rbi & everything up-to-date before a PR is merged. Have you considered doing something like that instead?

@bmulholland
Copy link
Author

What would a check on CI look like? Re-generate all the RBIs and then see if there are changes?

I have considered the CI check, but I also want something that helps with developer ergonomics; CI checks are too late for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants