can't update rails model
- by Tristan
Hi there,
I'm rather new to rails. I have a controller that's attempting to update a model using the following code:
@test = Product.find(1)
@test.increment!(:price)
It does successfully retrieve the Product from the database, but does not update the price attribute. Does anyone know why this might be the case, or how I could get more feedback on what the problem is?
Thanks a bunch!
Tristan
edit: price is an integer with value 0. I get the same problem when I set the price with @test.price=50 and then @test.save .