-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Load Solidus engine extension files automatically #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super! Just left a couple of things.
af42b93
to
061a674
Compare
@aldesantis I have one concern. We're adding new private methods to a class that inherits form So, instead of for example |
@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. |
f5f0aab
to
3ebfcbc
Compare
86e0126
to
3bdaf27
Compare
135f486
to
ce65e35
Compare
By cleanly separating extension files for the different Solidus engines, we can only load solidus_backend files when the engine itself is available rather than doing it all the time. In turn, this allows extensions to only actually require the parts of Solidus that they really need.
ce65e35
to
0073fc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aldesantis thank you 👍
This module doesn't just deal with decorators anymore, but also loads views and controllers, so this seems like a better name. Separating it into two modules wouldn't be simple because they are interlinked.
a2379e3
to
947778a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C O O L!
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 loadlib/views/backend
andlib/controllers/backend
, as well as the decorators inlib/decorators/backend
.This also renames
SolidusSupport::EngineExtensions::Decorators
toSolidusSupport::EngineExtensions
, since the module doesn't only deal with decorators anymore.