summaryrefslogtreecommitdiff
path: root/users/app/models/email.rb
blob: 45101c18573d5882bd26418960acbb11efce5940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class Email
  include CouchRest::Model::Embeddable

  property :email, String

  validates :email,
    :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/, :message => "needs to be a valid email address"}

  def to_s
    email
  end
end