Skip to content

Commit

Permalink
Merge pull request #1018 from Shopify/vs/fix_engine_loading_for_non_r…
Browse files Browse the repository at this point in the history
…ails

Use default gemfile path instead of Rails root when listing engines
  • Loading branch information
vinistock committed Jun 28, 2022
1 parent 6ff117f commit 697a5f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tapioca/runtime/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ def rails_engines

safe_require("active_support/core_ext/class/subclasses")

project_path = Bundler.default_gemfile.parent.expand_path
# We can use `Class#descendants` here, since we know Rails is loaded
Object.const_get("Rails::Engine")
.descendants
.reject(&:abstract_railtie?)
.reject { |engine| gem_in_app_dir?(Rails.root.to_path, engine.config.root.to_path) }
.reject { |engine| gem_in_app_dir?(project_path, engine.config.root.to_path) }
end

sig { params(path: String).void }
Expand Down

0 comments on commit 697a5f4

Please sign in to comment.