You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user doesn't have an avatar, then user.avatar.present? will be false but user.avatar.to_s returns avatar_missing.png. Therefore, image_tag current_user.avatar used to behave as expected:
…_path"
This reverts commit 21ec7fe.
Per #16911, there's actually a good reason for a "blank" value to have a
useful `to_s` here. So let's also add some tests to prove that.
…asset_path"
This reverts commit 21ec7fe.
Per rails#16911, there's actually a good reason for a "blank" value to have a
useful `to_s` here. So let's also add some tests to prove that.
There's a subtle change in
asset_path
between Rails 4.1 and 4.2 which breaks the ability to pass Paperclip::Attachment objects toimage_tag
.It changed from:
to:
Suppose you have a model like:
If a user doesn't have an avatar, then
user.avatar.present?
will be false butuser.avatar.to_s
returnsavatar_missing.png
. Therefore,image_tag current_user.avatar
used to behave as expected:but now it sets the
src
attribute of theimg
to""
:The text was updated successfully, but these errors were encountered: