Mongoid support cleanup

moving test specific == override part of the test models and not part of the Compatibility module included in all Mongoid docs. Made sure that nothing in devise itself uses this == between 2 different models, its purely for assert_equal
This commit is contained in:
Jacques Crocker
2010-03-27 16:16:36 -07:00
parent bb504e08aa
commit 6bcf18b04f
3 changed files with 10 additions and 4 deletions

View File

@@ -34,10 +34,6 @@ module Devise
end
super(validate)
end
def ==(other)
other.is_a?(self.class) && _id == other._id
end
end
end
end

View File

@@ -11,4 +11,9 @@ class Admin
options.delete(:order) if options[:order] == "id"
super options
end
# overwrite equality (because some devise tests use this for asserting model equality)
def ==(other)
other.is_a?(self.class) && _id == other._id
end
end

View File

@@ -13,4 +13,9 @@ class User
options.delete(:order) if options[:order] == "id"
super options
end
# overwrite equality (because some devise tests use this for asserting model equality)
def ==(other)
other.is_a?(self.class) && _id == other._id
end
end