OSDN Git Service

t#30307:change valid message for custom validator
[pettanr/pettanr.git] / lib / validators / sync_vh_validator.rb
index 04425fd..92c3a07 100644 (file)
@@ -1,7 +1,7 @@
 class SyncVhValidator < ActiveModel::EachValidator\r
   def validate_each(record, attribute, value)\r
     if record.picture and record.picture.flag_sync_vh < 0\r
-      record.errors[attribute] << (options[:message] || "sync_vh") unless sync?(record)\r
+      record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.sync_vh')) unless sync?(record)\r
     end\r
   end\r
   \r