summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-28 12:28:07 +0200
committerAzul <azul@leap.se>2014-05-28 12:28:07 +0200
commit09dfa583eca69a3925c384c67c3d98cd8c69b360 (patch)
tree3e10c0b2f0a785910e7b9460dd306eb2468fc71c /app
parent6fea83763f07add7d3bd07e3843b75aaf61e19b4 (diff)
allow changing the user_id on an identity
we set it to nil when we disable it
Diffstat (limited to 'app')
-rw-r--r--app/models/identity.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/identity.rb b/app/models/identity.rb
index 0d25bae..a8eaba6 100644
--- a/app/models/identity.rb
+++ b/app/models/identity.rb
@@ -130,7 +130,7 @@ class Identity < CouchRest::Model::Base
def alias_available
same_address = Identity.by_address.key(address)
- if same_address.detect { |other| other.user != self.user }
+ if same_address.detect { |other| other != self && other.user != self.user }
errors.add :address, :taken
end
end