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

Avoid early loading of ActionView::Base #532

Merged

Conversation

maximerety
Copy link
Contributor

@maximerety maximerety commented Jan 18, 2024

Brief Summary of Changes

The injection of the CloudinaryHelper module can happen lazily when ActionView::Base is loaded by some other code needing it, and there is no reason to trigger the loading early in the railtie.

A consequence of this change is that you can avoid the loading of ActionView::Base altogether in some cases, e.g. if running a specific test that does not need it, or when opening a rails console.

This aligns the behavior with the loading of Cloudinary::CloudinaryController which happens lazily too (see railtie.rb).

What does this PR address?

Are tests included?

  • Yes
  • No (railtie not tested)

Reviewer, please note:

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I ran the full test suite before pushing the changes and all the tests pass.

The injection of the CloudinaryHelper module can happen lazily when
ActionView::Base is loaded by some other code needing it, and there is
no reason to trigger the loading early in the railtie.

A consequence of this change is that you can avoid the loading of
ActionView::Base altogether in some cases, e.g. if running a specific
test that does not need it, or when opening a rails console.
@beauraF
Copy link

beauraF commented Jan 22, 2024

Sorry for the approval. Not fully awake. I thought it was change on our side..

@const-cloudinary const-cloudinary merged commit 1126492 into cloudinary:master Jan 24, 2024
3 checks passed
@const-cloudinary
Copy link
Contributor

@maximerety thank you for contribution!

@maximerety maximerety deleted the no-action-view-eager-load branch January 25, 2024 10:12
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.

None yet

3 participants