small medium large xlarge

18 Feb 2012, 19:23
Richard Back (1 post)

Book Example:

validates :price, numericality: (greater_that_or_equal_to: 0.01}

This validation worked when using the book example of wibble. However, when using the value 0.001 it was accepted and added the record to the database?

I have checked the schema.rb file and price is defines as follows:

t.decimal "price", :precision => 8, :scale => 2

Did I miss something?

Thanks in advance


You must be logged in to comment