Skip to content

Commit

Permalink
Encapsulate UniquenessValidator in SuperModel namespace instead of di…
Browse files Browse the repository at this point in the history
…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
Mani Tadayon authored and maccman committed Feb 11, 2011
1 parent 8056239 commit c2bab16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/supermodel/validations/uniqueness.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit c2bab16

Please sign in to comment.