devise_couch_potato 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/devise_couch_potato.gemspec +1 -1
- data/lib/devise/orm/couch_potato.rb +2 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/devise_couch_potato.gemspec
CHANGED
@@ -11,7 +11,8 @@ module Devise
|
|
11
11
|
if self.respond_to?("by_#{attrib}")
|
12
12
|
validate "uniqueness_of_#{attrib}".to_sym
|
13
13
|
define_method "uniqueness_of_#{attrib}" do
|
14
|
-
|
14
|
+
same = self.class.find(:conditions => { attrib => self.send(attrib) })
|
15
|
+
if same && same.id != self.id
|
15
16
|
self.errors.add(attrib, options[:message] || :taken)
|
16
17
|
end
|
17
18
|
end
|