Reputation: 33
spree/core/app/models/spree/product.rb
This is file that is stored in my gem file. I want to add some functionality to model file, so how to extend gem file in my app.
Upvotes: 0
Views: 378
Reputation: 1104
You can use decorators. Create a product_decorator.rb in app/models/spree
product_decorator.rb
app/models/spree
Spree::Product.class_eval do #Place your functionality here def some_action ... end end
Refer this document. A simple google could have got you this document.
Upvotes: 1