Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dependency on the engines load order when adding paths
We were adding the view and controller paths at engine loading time. So, E.g., if a frontend engine was present, but we loaded it after the extension depending on `solidus_support` (i.e., the extension went first on the `Gemfile`), paths weren't being loaded. We're adding the paths on an initializer that runs before Rails's [`:initialize_dependency_mechanism`](https://github.com/rails/rails/blob/127dd06df66552dd272eea7832f8bb205cf6fd01/railties/lib/rails/application/bootstrap.rb#L68) one. Thenceforth Rails begins messing with the load paths, and it doesn't take them into account anymore. Keep in mind that the `SolidusSupport.#{engine}_available?` call needs to be placed within the `initializer` context and not wrapping it. The reason is the same as above: don't doing the logic at load time.
- Loading branch information