Guest User

Untitled

a guest
Jun 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. module ActiveRecord
  2. class Base
  3. def self.validates_difference_of(a, b, options = {})
  4. validate do |record|
  5. record.errors.add(a, "must be different from #{b}") if record[a] == record[b]
  6. end
  7. end
  8. end
  9. end
Add Comment
Please, Sign In to add comment