Typically, with Authlogic, you would authenticate with some unique identifier (e.g. email or username) and a password. Authlogic does this by first finding the record by the identifier (User.find_by_email_address(email)
or similar), then calling then .authenticate
method on the returned object, which checks the password against the record.
What I want to do is change the way Authlogic finds the record (at a finer level than just changing the field it uses). My use case requires that the email_address
column (in this case) is in an associated child model.
Essentially, I want to ask Authlogic to find my User
record based on the presence of an associated Subscriber
model that is uniquely identified by the email_address
that is provided.
Has anyone seen Authlogic accommodate this?