Permalink
Browse files

Encapsulate UniquenessValidator in SuperModel namespace instead of di…

…rectly monkeypatching ActiveModel.

With the monkeypatch, if SuperModel was used alongside ActiveRecord, Mongoid or any other library that implemented its own UniquenessValidator, conflicts would occur.
  • Loading branch information...
1 parent 8056239 commit c2bab16badff74b2672354f4901af23216c46138 @bowsersenior bowsersenior committed with maccman Feb 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/supermodel/validations/uniqueness.rb
@@ -1,6 +1,6 @@
-module ActiveModel
+module SuperModel
module Validations
- class UniquenessValidator < EachValidator
+ class UniquenessValidator < ActiveModel::EachValidator
attr_reader :klass
def validate_each(record, attribute, value)

0 comments on commit c2bab16

Please sign in to comment.