OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
t#29400
[pettanr/pettanr.git]
/
lib
/
validators
/
reverse_validator.rb
1
class ReverseValidator < ActiveModel::EachValidator
\r
2
def validate_each(record, attribute, value)
\r
3
if record.picture and record.picture.flag_reverse < 0
\r
4
record.errors[attribute] << (options[:message] || "no reverse") if value < 0
\r
5
end
\r
6
end
\r
7
end
\r
8
\r