-
Notifications
You must be signed in to change notification settings - Fork 10
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
Rails 7 support #25
Comments
Native enums are supported by 7, so I'll probably do one more release to officially deprecate this library so people can migrate their schemas. |
@alassek I have really enjoyed using your gem. Thanks so much for all of your work! ❤️ |
@alassek if you have the time, it would really appreciate a guide for how to adopt the Rails 7 things. I was able to figure out the model changes, but I'm having trouble finding how to update the migrations other using using plain SQL. For others, this is what I in my models: KINDS = %w[foo bar]
# Before
include PGEnum(kind: KINDS, _suffix: true)
# After
enum :kind, KINDS.index_by(&:to_sym), suffix: true Also the Rails 7 docs say |
@soffes thank you, I glad that it was useful! Lately I've been much happier working with ROM, so it's just as well that Rails is obsoleting this gem. The major difference is that my syntax was As for the module builder, my recommendation is to just copy-paste the code into your project. It's a very small part of the gem, not really worth the dependency on its own. |
Nevermind, this is now in Rails 7. When upgrading to Rails 7, you will remove this gem and: replace the model enum defs
with the default rails
and in the rails migration covered recently in my Hot Glue tutorial |
Rails 7 added better enum model support for PG enums though only added the See my Rails 7 PR that adds all of the migration commands to Rails 7 rails/rails#44898 |
@rayfaddis That's a fair point. I will release a new version with only the additional stuff. |
Version 2.0 has been released for Rails 7, there are a couple breaking interface changes. See CHANGELOG for more info |
@alassek - can you explain what advantage this gem has over the native Rails 7 tools? |
@jasonfb Everything that Rails 7 has implemented has been dropped from 2.0 but there were some additional migration helpers that they didn't implement:
|
[PGEnum] Current ActiveRecord version unsupported! Falling back to: 6.1
The text was updated successfully, but these errors were encountered: