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
  • 10,918
  • 11
  • 54
  • 88

1 Answers1

0

Use numericality instead of numerically

kobaltz
  • 6,730
  • 1
  • 35
  • 51