drhenner / ror_ecommerce

Ruby on Rails Ecommerce platform, perfect for your small business solution.
www.ror-e.com
MIT License
1.21k stars 409 forks source link

undefined local variable or method `amount_to_credit' #75

Closed mitfik closed 11 years ago

mitfik commented 11 years ago

Hi

After merging with latest version I've got:

undefined local variable or method `amount_to_credit' for #<#<Class:0xaf20558>:0xaea6b18>

it's point to:

62:       <% if @order.amount_to_credit && amount_to_credit > 0.0 %>

and it seems to be related with this one: 7af7f8a8a11d4d2fd4e17840bd25e536f8bdb7a7

the amount_to_credit method seems to be not defined.

any thoughts?

mitfik commented 11 years ago

it should be:

62:       <% if @order.amount_to_credit && @order.amount_to_credit > 0.0 %>

Right? :>

deanpcmad commented 11 years ago

Not too sure as I haven't worked on this app for a few months but this method is defined here - https://github.com/drhenner/ror_ecommerce/blob/master/app/models/order.rb#L341

mitfik commented 11 years ago

yes it is and the error is in the view, which means that the amount_to_credit is not defined there but for order model. This is why I think that it should be @order.amount_to_credit. Even if you will look on the code logic, you want to show it if the amount exist and is greater then 0.0

deanpcmad commented 11 years ago

Ah yes I see the problem

drhenner commented 11 years ago

Yeah that is the issue. it should be @order.amount_to_credit.... I thought I had found and fixed that... hmmm... Let me check if I never pushed the fix.

drhenner commented 11 years ago

fixed...