1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 This article was migrated from http://rails.office.drecom.jp/hibi/archive/31 ちょっとはまる。 ■下記はOK validates_length_of :product_code, :maximum => 255, :if => Proc.new { |mono| mono.product_code != nil} ■下記はNG validates_length_of :product_code, :maximum => 255, :allow_nil => true http://rails.office.drecom.jp/hibi/archive/31