X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/9b4770e85ce3add247c6462002ca910f6ba103da..b82ac70a3367072882aa259dae0b6a1b6e3288fa:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 17fe702..1358840 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,6 +25,10 @@ class User < ActiveRecord::Base def name [ firstname, lastname].join(" ") end + + def email=(new_email) + self[:email] = new_email + end # Authenticates a user by their login name and unencrypted password. Returns the user or nil. def self.authenticate(login, password) @@ -82,4 +86,5 @@ class User < ActiveRecord::Base errors.add(:login, "should not begin or end with spaces") if login and login.strip! errors.add(:login, "should contain only letters, numbers, and spaces") unless login =~ /^[A-Za-z0-9 ]*$/ end + end