summaryrefslogtreecommitdiff
path: root/users/app/models/remote_email.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-01-17 22:45:39 -0800
committerazul <azul@riseup.net>2013-01-17 22:45:39 -0800
commit168c36b578d675c99aad62a350aa68cc1b6d1316 (patch)
treecd1df0a9a7d3f0a9812b512cfb93db0f79b0421f /users/app/models/remote_email.rb
parent19d563e2e2db98ecc5143229f554df6a09bc457e (diff)
parent27730c7e665ed64e691fdf6dbeebc39c8bfbbc4b (diff)
Merge pull request #18 from leapcode/feature/fixed-email-address
make email address just login@domain.tld
Diffstat (limited to 'users/app/models/remote_email.rb')
-rw-r--r--users/app/models/remote_email.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/users/app/models/remote_email.rb b/users/app/models/remote_email.rb
new file mode 100644
index 0000000..4fe7425
--- /dev/null
+++ b/users/app/models/remote_email.rb
@@ -0,0 +1,14 @@
+class RemoteEmail
+ include CouchRest::Model::Embeddable
+ include Email
+
+ property :email, String
+
+ def username
+ email.spilt('@').first
+ end
+
+ def domain
+ email.split('@').last
+ end
+end