In Hyku and Hyrax there are long-standing references to Rails.root. This works when Hyku is the base application. However, with Knapsack, we need to consider an alternate approach to Rails.root.
The issue is as follows:
Rails.root resolves to the root of the Hyku application
Knapsack is intended to be an overlay of that application; meaning if I add a static file in Knapsack we would want Hyku to pick that up.
However, Hyrax also uses Rails.root to reference static files. I used rg Rails.root app lib --files-with-matches | awk '{ print "- [ ] " $1 } to generate the list of files that need reviewing:
In Hyku and Hyrax there are long-standing references to
Rails.root
. This works when Hyku is the base application. However, with Knapsack, we need to consider an alternate approach toRails.root
.The issue is as follows:
Rails.root
resolves to the root of the Hyku applicationA proposed solution for Hyku is available here:
However, Hyrax also uses
Rails.root
to reference static files. I usedrg Rails.root app lib --files-with-matches | awk '{ print "- [ ] " $1 }
to generate the list of files that need reviewing:This is also reported in:
We'll also want to add a rubocop to indicate the
Rails.root
is an anti-pattern.