Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ActiveRecord
- class Base
- def self.validates_difference_of(a, b, options = {})
- validate do |record|
- record.errors.add(a, "must be different from #{b}") if record[a] == record[b]
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment