I think you wanted to code something like this

```ruby
    user = User.find_by_email(user_email)

    if user && user.avatar.present?
      user.avatar.url
    else
      gravatar_icon(user_email, size)
    end
```