Re: [Rails] validation problems

2010-02-10 Thread Conrad Taylor
On Tue, Feb 9, 2010 at 4:03 PM, Ichiro Saga li...@ruby-forum.com wrote: Hi, there. I have two validations in the model: validates_numericality_of :value, :only_integer=true, :allow_blank=true validates_size_of :value, :is=9, :message=must be 5-digit number, :if=Proc.new{|u|

[Rails] validation problems

2010-02-09 Thread Ichiro Saga
Hi, there. I have two validations in the model: validates_numericality_of :value, :only_integer=true, :allow_blank=true validates_size_of :value, :is=9, :message=must be 5-digit number, :if=Proc.new{|u| u.value.is_a?(Numeric)} They work as expected except when the :value is character/string like