What's wrong with this model method?

class RepairTicket < ActiveRecord::Base

  def calc_iva
   total_price=total_price+1000
  end

end

r=RepairTicket.find(74)
r.calc_iva

NoMethodError: undefined method `calc_iva' for #<RepairTicket:0x29293dc>
  from
/Users/juan/Desktop/dticket/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:205:in
`method_missing'

Can you show us the whole model please?

This is a guess:

You’re testing in console and adding methods. Console doesn’t auto reload.

When you make a change to a model, type this:

reload!

You’ll have to re-instantiate your objects too.

I recommend unit testing instead, which it appears that you’re doing manually.

Again, just guessing.