Hi all;
I'm just passing along something I discovered that wasn't entirely obvious
to me. In trying to recover a password as a test, I was baffled why I was
getting the reset email for one account, but not for another.
It turns out that the :request_password_reset cycle will return without
doing anything if you model has any validations on it that fail, and no
validation failure is reported or recorded in the log. There was no hint
that something was failing.
In my case, I had a "preauth" field in my User model that was supposed to
be between a min and max value:
validates :preauth, :inclusion => { :in =>
Yetting.preauth_min..Yetting.preauth_max, :message => proc {
I18n.t('preauth_limit', :preauth_min => Yetting.preauth_min, :preauth_max
=> Yetting.preauth_max) } }
And, the record that failed to issue the password reset email had a preauth
field value that did not pass the validation. The field happened to be Null.
Who knew?
Hopefully, this little nugget will save someone else some lost time.
Tim
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.