Skip to content

Makes this gem compatible with Zeitwerk.#39

Merged
armahillo merged 2 commits intomainfrom
make-validating-enum-zeitwerk-friendly
Sep 2, 2022
Merged

Makes this gem compatible with Zeitwerk.#39
armahillo merged 2 commits intomainfrom
make-validating-enum-zeitwerk-friendly

Conversation

@armahillo
Copy link
Copy Markdown
Contributor

Zeitwerk is Rails 6's autoloading magician. It has one demand: if a file
exists in the autoloading paths, that file has to define an
appropriately-named constant.

Because of reasons, we had to disable the Validating Enum a while back.
(Ironically, because of Rails 6) The file still exists, but wasn't
defining the module.

This commit re-defines the module, but leaves it empty. This is a
harmless change, and I've verified locally that it satisfies Zeitwerk.
We don't have to also do this with the stuff under lib/ because that is
not autoloaded by default.

Zeitwerk is Rails 6's autoloading magician. It has one demand: if a file
exists in the autoloading paths, that file has to define an
appropriately-named constant.

Because of reasons, we had to disable the Validating Enum a while back.
(Ironically, because of Rails 6) The file still exists, but wasn't
defining the module.

This commit re-defines the module, but leaves it empty. This is a
harmless change, and I've verified locally that it satisfies Zeitwerk.
We don't have to also do this with the stuff under lib/ because that is
not autoloaded by default.
@armahillo armahillo self-assigned this Sep 2, 2022
@armahillo armahillo requested review from a team and jcavena and removed request for jcavena September 2, 2022 17:28
Copy link
Copy Markdown
Contributor

@jcavena jcavena left a comment

Choose a reason for hiding this comment

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

Can we remove the file entirely instead? We could resurrect it if we think it's worth fixing in the future.

@armahillo
Copy link
Copy Markdown
Contributor Author

fine by me!

Ignore the last commit message.

Well, partly ignore it.

We'll just strip out validating enum stuff entirely since it's both not
in use and is also confusing zeitwerk.
@armahillo armahillo force-pushed the make-validating-enum-zeitwerk-friendly branch from 6ca3246 to 98e5578 Compare September 2, 2022 17:38
@armahillo armahillo merged commit 7564ac3 into main Sep 2, 2022
@armahillo armahillo deleted the make-validating-enum-zeitwerk-friendly branch September 2, 2022 18:33
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