1 class ResizeValidator < ActiveModel::EachValidator
\r
2 def validate_each(record, attribute, value)
\r
3 if record.picture and record.picture.flag_resize < 0
\r
4 record.errors[attribute] << (options[:message] || "no resize") unless value == record.picture[attribute]
\r