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|
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
2 matches
Mail list logo