Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created February 12, 2009 04:15
Show Gist options
  • Save edavis10/62482 to your computer and use it in GitHub Desktop.
Save edavis10/62482 to your computer and use it in GitHub Desktop.
diff --git a/app/models/user.rb b/app/models/user.rb
index b35c1a8..4f8223d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -80,6 +80,15 @@ class User < ActiveRecord::Base
super
end
+ def identity_url=(url)
+ begin
+ self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
+ rescue InvalidOpenId
+ # Invlaid url, don't save
+ end
+ self.read_attribute(:identity_url)
+ end
+
# Returns the user that matches provided login and password, or nil
def self.try_to_login(login, password)
# Make sure no one can sign in with an empty password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment