plugin assets fail to precompile with TypeError: couldn't digest ActiveSupport::StringInquirer
After the update to include Patternfly which required bumping sprockets to version 3+, plugin assets precompile task fails with:
TypeError: couldn't digest ActiveSupport::StringInquirer
Fixes #13098: Set assets environment the same as core assets
The introduction of Sprockets 3+ led to the environment-version
being set to ActiveSupport::StringInquirer object instead of a
String. The Sprockets digest method does not support digesting
classes of type ActiveSupport::StringInquirer.
This change explicitly sets the assets environment version to be
calculated the same as core assets when precompiling. When core
assets are precompiled using the normal Rails assets:precompile rake
task the environment string is generated in such a way as to create
a unique string and thus unique digest. The plugin:asset:precompile
task will now do the same and explicitly ensure it is set to
production given the task does not require a true Rails environment
to be declared.