summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-16 19:38:37 +0200
committerAzul <azul@leap.se>2013-07-24 10:55:50 +0200
commit38e7ba3a7c7a414c5b087f7f32df1a09403fff89 (patch)
treedbb786b3abe10cefb226bf53297fa219cdef864f /users/app
parent21f39bf368ea1e0deb70eb918f0947fb6fbd900d (diff)
first take on identity model - still broken
Diffstat (limited to 'users/app')
-rw-r--r--users/app/models/identity.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/users/app/models/identity.rb b/users/app/models/identity.rb
new file mode 100644
index 0000000..a081394
--- /dev/null
+++ b/users/app/models/identity.rb
@@ -0,0 +1,20 @@
+class Identity < CouchRest::Model::Base
+
+ use_database :identities
+
+ belongs_to :user
+
+ property :address
+ property :destination
+
+ def initialize(attribs = {}, &block):q
+ attribs.reverse_merge! user_id: user.id,
+ address: user.main_email_address,
+ destination: user.main_email_address
+ Identity.new attribs
+ end
+
+ design do
+ view :by_user_id
+ end
+end