summaryrefslogtreecommitdiff
path: root/users/app/models
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-12-09 13:19:54 +0100
committerAzul <azul@leap.se>2012-12-09 13:19:54 +0100
commit9d99d340cfd3c55f21d38c1ba9f3f4574e40c46c (patch)
tree702e054dd3ba027795cd57ff980311a52a575016 /users/app/models
parent4dffda05477f74c90197948bb6f13bedc8b2a19f (diff)
basic form added to user settings, simple model created
Diffstat (limited to 'users/app/models')
-rw-r--r--users/app/models/email_alias.rb6
-rw-r--r--users/app/models/user.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/users/app/models/email_alias.rb b/users/app/models/email_alias.rb
new file mode 100644
index 0000000..25e4b27
--- /dev/null
+++ b/users/app/models/email_alias.rb
@@ -0,0 +1,6 @@
+class EmailAlias
+ include CouchRest::Model::Embeddable
+
+ property :email, String
+ timestamps!
+end
diff --git a/users/app/models/user.rb b/users/app/models/user.rb
index ae271ce..81d5262 100644
--- a/users/app/models/user.rb
+++ b/users/app/models/user.rb
@@ -1,11 +1,13 @@
class User < CouchRest::Model::Base
property :login, String, :accessible => true
- property :email, String, :accessible => true
- property :email_forward, String, :accessible => true
property :password_verifier, String, :accessible => true
property :password_salt, String, :accessible => true
+ property :email, String, :accessible => true
+ property :email_forward, String, :accessible => true
+ property :email_aliases, [EmailAlias]
+
validates :login, :password_salt, :password_verifier,
:presence => true