This is my first post on the list but before I ask for help I would to thank you all for the wonderful platform that you have created.
On a project I’m working on there is a need for a donation/donate functionality. I’ve followed the customization guide (http://spreecommerce.com/documentation/customization.html) to add new logic to the Order model.
I’ve added a new file called ‘order_decorator.rb’ inside ‘app/models’ and added:
Order.class_eval do
def my_method
# custom code
end
end
and I’m getting the following error:
order_decorator.rb:1:in `<top (required)>': uninitialized constant Order (NameError)
Anyone can add some light to my problem?
This was cross posted the Spree mailing list https://groups.google.com/d/topic/spree-user/mGcj4EpGuYo/discussion
Thanks Brian (https://groups.google.com/forum/#!topic/spree-user/mGcj4EpGuYo/discussion) for the fix. In spree the require statement needed to add all the files that end with ‘_decorator’ need to go inside the ‘self.activate’ block: