solidusio / solidus_support

Common runtime helpers for Solidus extensions.
BSD 3-Clause "New" or "Revised" License
9 stars 23 forks source link

Load Solidus engine extension files automatically #42

Closed aldesantis closed 4 years ago

aldesantis commented 4 years ago

Improves EngineExtensions::Decorators to automatically load the right files when Solidus engines are installed. For instance, if solidus_backend is installed, it will tell Rails to load lib/views/backend and lib/controllers/backend, as well as the decorators in lib/decorators/backend.

This also renames SolidusSupport::EngineExtensions::Decorators to SolidusSupport::EngineExtensions, since the module doesn't only deal with decorators anymore.

spaghetticode commented 4 years ago

@aldesantis I have one concern.

We're adding new private methods to a class that inherits form Rails::Engine, a class that we don't own. I wonder if the new methods, having a rather generic name, may end up in overriding the ones that could be defined by the superclass in a remote but still plausible future.

So, instead of for example decorators_root, would something like solidus_decorators_root make more sense?

aldesantis commented 4 years ago

@spaghetticode I think that's a good point. It seems unlikely that Rails will officially introduce the concept of engines at some point, but it doesn't hurt to give the methods names that are a bit more specific.