-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix installation method as a gem executable
To support `solidus_auth_devise`, it needs to rely on a new version of `solidus_support` that changes how it detects if a Solidus frontend is available and the moment it adds the extensions' controller & view directories to the Rails known paths. The previous `solidus_support` version added the extensions' paths on the engine's (in this case, `solidus_auth_devise`'s engine) load time and only when `SolidusSupport#frontend_available?` returned `true`. Engines are loaded before the application code, so at that time, the monkey patching of `#frontend_available?` that we were generating was not at hand. The solution is two-fold: we add the paths on an `initializer` on one side. However, at that moment, the application code is neither available, so on the other side, we change `#frontend_available?` to look for a `Rails.configuration.x.solidius.frontend_available` setting that we add to `application.rb` using the generator code. To understand the whole picture, keep in mind that `Rails.configuration` is available on an initializer, but it's not on an engine's load time. On top of that, we need to update a couple of things on the generated code: - We need to reference `Rails.root` instead of `Engine.root`, as `SolidusStarterFrontend::Engine` is unavailable on this installation method. - We need to copy to `application.rb` the custom code on `SolidusStarterFrontend::Engine` for the same reason as above.
- Loading branch information
1 parent
5f86542
commit 9e7bfd6
Showing
6 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.