Skip to content
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 for rails 7? #305

Open
simonsapiel opened this issue Apr 27, 2022 · 1 comment
Open

Support for rails 7? #305

simonsapiel opened this issue Apr 27, 2022 · 1 comment

Comments

@simonsapiel
Copy link

Is there any plans to support rails 7? The gem is currently preventing me from upgrading my rails 6.1 app to rails 7 as it breaks down (#302) with rails 7.

@fxn
Copy link

fxn commented May 16, 2022

Hey, the problem is that in Rails 7 you cannot autoload reloadable code so early.

Also, it does not make sense that ImpressionistController::ClassMethods and ImpressionistController::InstanceMethods live in a reloadable file, because changes in that code won't be reflected in ActionController::Base, which is decorated only once during boot.

Would it make sense to extract those two decorators to lib and require them normally?

keegnotrub added a commit to ConvertKit/impressionist that referenced this issue Oct 16, 2023
Instead of depending on autoload to bring in the ImpressionistController
constant, we manually bring it with a call to require and just move that file
to lib.

Prior to this, Rails would emit a warning on startup about needing to use
autoload durning an initializer like this, letting us know that a future
version of Rails will error.

This should hopefully remove that error and still allow these controller mixins
to be available.  Note that Rails 7.1 will eventually be a future blocker here.

PS. This is the recommended approach by Xavier here:
charlotte-ruby#305

Co-authored-by: stefannibrasil <10670581+stefannibrasil@users.noreply.github.com>
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

No branches or pull requests

2 participants