{"action":"opened","issue":{"url":"https://api.github.com/repos/NoamB/sorcery/issues/762","repository_url":"https://api.github.com/repos/NoamB/sorcery","labels_url":"https://api.github.com/repos/NoamB/sorcery/issues/762/labels{/name}","comments_url":"https://api.github.com/repos/NoamB/sorcery/issues/762/comments","events_url":"https://api.github.com/repos/NoamB/sorcery/issues/762/events","html_url":"https://github.com/NoamB/sorcery/issues/762","id":138329502,"number":762,"title":"Sorcery ActiveRecord Adapter always uses email attribute","user":{"login":"chadwilken","id":2219044,"avatar_url":"https://avatars.githubusercontent.com/u/2219044?v=3","gravatar_id":"","url":"https://api.github.com/users/chadwilken","html_url":"https://github.com/chadwilken","followers_url":"https://api.github.com/users/chadwilken/followers","following_url":"https://api.github.com/users/chadwilken/following{/other_user}","gists_url":"https://api.github.com/users/chadwilken/gists{/gist_id}","starred_url":"https://api.github.com/users/chadwilken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadwilken/subscriptions","organizations_url":"https://api.github.com/users/chadwilken/orgs","repos_url":"https://api.github.com/users/chadwilken/repos","events_url":"https://api.github.com/users/chadwilken/events{/privacy}","received_events_url":"https://api.github.com/users/chadwilken/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-03T23:29:39Z","updated_at":"2016-03-03T23:29:39Z","closed_at":null,"body":"I haven't changed any sorcery or user related code for a while but all of a sudden Sorcery is always trying to use the `email` attribute when performing `find_by`. My config is below and I confirmed that the configuration is being loaded.  Not sure if you might have a solution for this other than adding an `alias_attribute` on the `User` class. I didn't update the gem just simply ran tests and it magically started failing. I attempted to remove the gem and reinstall to no change.\r\n\r\nMy config file:\r\n```\r\nrequire 'legacy_encryption_provider'\r\n# The first thing you need to configure is which modules you need in your app.\r\n# The default is nothing which will include only core features (password encryption, login/logout).\r\n# Available submodules are: :user_activation, :http_basic_auth, :remember_me,\r\n# :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external\r\nRails.application.config.sorcery.submodules = [:reset_password]\r\n\r\n# Here you can configure each submodule's features.\r\nRails.application.config.sorcery.configure do |config|\r\n  # --- user config ---\r\n  config.user_config do |user|\r\n    user.username_attribute_names = [:username, :email_address]\r\n    user.downcase_username_before_authenticating = true\r\n    user.email_attribute_name = :email_address\r\n    user.crypted_password_attribute_name = :crypted_password\r\n    user.salt_attribute_name = nil\r\n    user.custom_encryption_provider = LegacyEncryptionProvider\r\n    user.encryption_algorithm = :custom\r\n    user.reset_password_token_attribute_name = :reset_password_token\r\n    user.reset_password_mailer = UserMailer\r\n  end\r\n\r\n  # This line must come after the 'user config' block.\r\n  # Define which model authenticates with sorcery.\r\n  config.user_class = \"User\"\r\nend\r\n```"}}