diff options
author | Azul <azul@riseup.net> | 2016-10-20 14:39:33 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-10-20 14:39:33 +0200 |
commit | b97daaed9b513006ace7e8eb5232a2211e965e77 (patch) | |
tree | e27002e8368e92410e5d4af2a945260c2ea6e2d1 /app/models/email.rb | |
parent | c6c4d9fd10b8ca8e24889112727e44c9bf68dd60 (diff) | |
parent | 6eb2dae802e5453e2a4361ab28f614cce9294f4c (diff) |
Merge remote-tracking branch 'origin/develop'
We'll only use the master branch for development from now on.
Diffstat (limited to 'app/models/email.rb')
-rw-r--r-- | app/models/email.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/app/models/email.rb b/app/models/email.rb deleted file mode 100644 index 4090275..0000000 --- a/app/models/email.rb +++ /dev/null @@ -1,31 +0,0 @@ -class Email < String - include ActiveModel::Validations - - validates :email, - :format => { - :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/, #local part of email is case-sensitive, so allow uppercase letter. - :message => "needs to be a valid email address" - } - - # Make sure we can call Email.new(nil) and get an invalid email address - def initialize(s) - super(s.to_s) - end - - def to_partial_path - "emails/email" - end - - def to_param - to_s - end - - def email - self - end - - def handle - self.split('@').first - end - -end |