summaryrefslogtreecommitdiff
path: root/users/app/models/email.rb
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/models/email.rb')
-rw-r--r--users/app/models/email.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/users/app/models/email.rb b/users/app/models/email.rb
index 90fc645..1bcff1c 100644
--- a/users/app/models/email.rb
+++ b/users/app/models/email.rb
@@ -1,13 +1,11 @@
class Email < String
-=begin
- included do
- validates :email,
- :format => {
- :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/,
- :message => "needs to be a valid email address"
- }
- end
-=end
+ include ActiveModel::Validations
+
+ validates :email,
+ :format => {
+ :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/,
+ :message => "needs to be a valid email address"
+ }
def to_partial_path
"emails/email"
@@ -17,4 +15,8 @@ class Email < String
to_s
end
+ def email
+ self
+ end
+
end