spree / deface

Rails plugin that allows you to customize ERB views in a Rails application without editing the underlying view.
MIT License
520 stars 127 forks source link

Do not modify frozen eager_load_paths Array #176

Closed mamhoff closed 6 years ago

mamhoff commented 7 years ago

When one does not change config.auto_load_paths in the host app, by the time the deface.tweak_eager_loading initializer runs, {app,railtie}.config.eager_load_paths is frozen.

Running reject! on a frozen Array results in an error, preventing the host app from starting.

This commit modifies the initializer such that instead of modifying the array, it is replaced by the modified array, preventing this error.

damianlegawiec commented 6 years ago

Thank you guys for this fix! 👍