the price is supposed to be a string in number format but can include
other non-digital characters like 'a', since :only_integer is set to
false by default, right?
In rails implementation, it use Kernel.Float to complete the work. But
seems Kernel.Float(ruby 1.8.6) always throw an exception when the
number string contains non-digital characters, such as "123.00a". So
in fact there is no diffierences whether the switch :only_integer is
turned on or off.
I found in JRuby, the Kernel.Float will accept string that looks like
"123.00a" but will finally return a zero.
only_integer means it will only allow integers. Otherwise, decimal
places are allowed. You will need to write a custom method to
validate the "numericality" of strings containing alpha characters.