cloudinary / cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
https://cloudinary.com
420 stars 285 forks source link

Avoid early loading of ActionView::Base #532

Closed maximerety closed 7 months ago

maximerety commented 7 months ago

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?

Reviewer, please note:

Checklist:

beauraF commented 7 months ago

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

const-cloudinary commented 7 months ago

@maximerety thank you for contribution!