OSDN Git Service

fix
[pettanr/pettanr.git] / lib / validators / reverse_validator.rb
1 class ReverseValidator < ActiveModel::EachValidator\r
2   def validate_each(record, attribute, value)\r
3     record.picture.boosts 'post'\r
4     if record.picture and record.picture.license_extend.reverse < 0\r
5       record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.reverse')) if value < 0\r
6     end\r
7   end\r
8 end\r
9 \r