How to upgrade your Spree extension to work with Spree 4
app/models/spree/order_decorator.rb
) using class_eval.
To fix this we need to convert all class_eval
decorators to modules and use Module.prepend. Also we need to name them properly according to Zeitwerk naming rules
Example of an old decorator:
app/models/spree/order_decorator.rb
app/models/your_extension_name/order_decorator.rb
spec_helper.rb
contents with:
https://github.com/spree/spree/blob/777a284b4c70e69d32a05ffa61bbe3905d8f1297/cmd/lib/spree_cmd/templates/extension/spec/spec_helper.rb
Example migrations: