-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support Rails7 style enum definitions #268
Open
tk0miya
wants to merge
5
commits into
pocke:master
Choose a base branch
from
tk0miya:rails7_enum2
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+37
−91
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tk0miya
added a commit
to tk0miya/conference-app
that referenced
this pull request
Nov 6, 2023
As a preparation of giving types to controllers, this adds types for `Announcement::ActiveRecord_Relation#published` manually because current rbs_rails does not support Rails7 style enums. It should be removed if rbs_rails will support it in the future. refs: pocke/rbs_rails#268
Old minitest depends on mutex_m gem (before v5.21) without explicit dependency. So it causes dependency errors on CI because the mutex_m gem became the bundled gem since Ruby 3.4. This upgrade minitest to the latest version which does not depends on the mutex_m gem.
Since Ruby 3.4, mutex_m gem becames the bundled gem. So it should be listed on the dependencies list. Note: The latest activesupport now does not depends on it. So it's also okay to upgrade it to the new one.
Since Ruby 3.4, abbrev gem has became the bundled gem. But old rbs gem does not depend on it. This updates rbs gem to v3.4, which depends on abbrev gem explicitly.
Since Ruby 3.4, base64, bigdecimal, and drb gems have became the bundled gem. So they should be listed on the dependencies list. Note: The latest activesupport now depends on them. So it's also okay to upgrade it to the new one.
Since Rails7, the enum definition style has been changed. This uses a private a private method `#_enum_methods_module` to obtain the registered enum defintions to support both Rails5 and Rails7. Thanks to @ksss.
tk0miya
force-pushed
the
rails7_enum2
branch
from
February 10, 2024 15:47
f717832
to
a9ca3ed
Compare
Now rebased on #274 . |
Unfortunately, this approach doesn't work when |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since Rails7, the enum definition style has been changed. This uses a private a private method
#_enum_methods_module
to obtain the registered enum defintions to support both Rails5 and Rails7.Thanks to @ksss. (refs: #6)
This is yet another version of #267 (static analytics approach).