Rails: Same model validation failing Rails 5

Created on 17 Aug 2016  路  3Comments  路  Source: rails/rails

Steps to reproduce

I have the following validation in my model:
validates :price, numericality: { greater_than_or_equal_to: 0.01 }
Entering in price -5.0 when I submit the form, it fails and it shows me the error message in the view, but when I change the validation to this (it must do the same)
validates_numericality_of :price, greather_than_or_equal_to: 0.01
Doesn't validates and it gets created/saved correctly

System configuration

Rails version: 5.0.0.1

Ruby version: 2.3.1

activerecord

Most helpful comment

You misspelt 'greater' as 'greather'.

All 3 comments

You misspelt 'greater' as 'greather'.

asdfjklask thanks @sevenseacat

no problem :)

Was this page helpful?
0 / 5 - 0 ratings