Skip to content

Instantly share code, notes, and snippets.

@stevesohcot
Created January 30, 2016 19:56
Show Gist options
  • Save stevesohcot/043d68c3406bddd0cd07 to your computer and use it in GitHub Desktop.
Save stevesohcot/043d68c3406bddd0cd07 to your computer and use it in GitHub Desktop.
OmniAuth - Identity Model
class Identity < OmniAuth::Identity::Models::ActiveRecord
before_save :convert_to_lowercase
validates_presence_of :email, :password #, message: "can't be blank"
validates_uniqueness_of :email
private
def convert_to_lowercase
self.email = email.downcase
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment