OSDN Git Service

t#30307:change valid message for custom validator
[pettanr/pettanr.git] / lib / validators / resize_validator.rb
index be01eeb..87f9704 100644 (file)
@@ -1,7 +1,7 @@
 class ResizeValidator < ActiveModel::EachValidator\r
   def validate_each(record, attribute, value)\r
     if record.picture and record.picture.flag_resize < 0\r
-      record.errors[attribute] << (options[:message] || "no resize") unless value == record.picture[attribute]\r
+      record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.resize')) unless value == record.picture[attribute]\r
     end\r
   end\r
 end\r