This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use class_eval to override link_to_cart in Solidus Demo
Goal ---- As a Solidus Demo contributor I would like to use `class_eval` to override link_to_cart So that we can ensure that the `Spree::BaseHelper` engine module is reopened by Solidus Demo, which according to https://guides.rubyonrails.org/engines.html#improving-engine-functionality, is necessary for overriding the module. Basis ----- From https://guides.rubyonrails.org/engines.html#improving-engine-functionality: > It is very important that the override reopens the class or module. Using the class or module keywords would define them if they were not already in memory, which would be incorrect because the definition lives in the engine. Using `class_eval` as shown above ensures you are reopening.
- Loading branch information