Class: Validatable::ValidatesUniquenessOf

Inherits:
ValidationBase
  • Object
show all
Defined in:
lib/devise/orm/mongoid.rb

Instance Method Summary collapse

Instance Method Details

#message(instance) ⇒ Object



14
15
16
# File 'lib/devise/orm/mongoid.rb', line 14

def message(instance)
  "has already been taken"
end

#scopeObject

with devise, we need scope. This little hack no usefull with activeModel and Rails 3. So delete it with devise 1.1



6
7
8
9
10
11
12
# File 'lib/devise/orm/mongoid.rb', line 6

def scope
  if @scope == []
    nil
  else
    @scope
  end
end