1

I tried to use

validates :price, numerically: {greater_than_or_equal_to: 0.01}

to force a price to be greater than 0.01. However, no matter what number I put in, 0.001 or even 0, as long as its numerical, it passes the test. Can anyone tell me why and how can I revise it?

OneZero
  • 11,556
  • 15
  • 55
  • 92

1 Answers1

0

Use numericality instead of numerically

kobaltz
  • 6,980
  • 1
  • 35
  • 52