Fix issue #6847#6905
Conversation
|
Thank you! Could you add a test or two? |
|
Sure. I'm new to rspec, so you might want to double-check me on those. |
| problem_user.save | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
I don't think setting it to nil can ever make a user fail validation, so User.where(unconfirmed_email: email).update_all(unconfirmed_email: nil) should be much, much faster.
|
Okay, I'll make those changes. Should I change the other tests which use new@email.com while I'm at it? Forgive my noobishness, but is there an example of an error using a translation somewhere in the codebase I could look at? Not quite sure how to go about it as-is. Also, just changed the controller code a little. Pronto is now complaining about the line after the one I changed having single quotes instead of double; I'm tentatively ignoring this (?) because it matches all the others. |
|
Yeah, changing the other tests seems fine. http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models goes a bit into validation error translations, I actually never tried myself, but if the interpolation variant works for custom errors, it would be highly preferable. Would be awesome if you could find out. I think we also have some stuff to clean up if so ;) If you need to add any translation strings, only edit the English locale. You always should follow pronto's messages. We introduced a fixed styleguide much much later and are porting the codebase to it as we touch things. Porting everything to a consistent style at once would just be too many changes at once. |
|
Got everything sorted. As it turns out, there was a message (errors.messages.taken) that matched what I was after, so I didn't end up learning about custom messages. However, the message might not be relevant at the moment. Currently, the users controller flashes generic messages on a failed save (e.g., "Email change failed") rather than making any reference to the errors in question. Is this behavior that should be modified? |
| format.atom do | ||
| @posts = Post.where(author_id: @user.person_id, public: true) | ||
| .order('created_at DESC') | ||
| .order("created_at DESC") |
There was a problem hiding this comment.
Align .order with .where on line 114.
Perhaps, but not in this PR ;) |
|
Thanks! |
No description provided.