Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed avatar_url #155

Merged
merged 2 commits into from
Dec 12, 2011
Merged

Fixed avatar_url #155

merged 2 commits into from
Dec 12, 2011

Conversation

pcantrell
Copy link

(1) It now uses the correct Gravatar URL syntax, rather than putting a spurious ".jpg" in the query string.
(2) It actually respects the :size option.
(3) It supports Gravatar's custom default image options.

…actually respects the :size option, and (3) supports a custom default image.
size = ("?s=#{options[:size]}" if options[:size])
"http://gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email.to_s.strip.downcase)}#{size}.jpg"
params = {
s: options[:size] || 60,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hash syntax will break on ruby 1.8.x and the same goes for line below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my bad. I'll fix and resubmit when I have a minute.

@pcantrell
Copy link
Author

Look OK?

I wanted to add a spec for this, but wasn't sure how to run tests. I found instructions for running specs on the main refinerycms project, but it's not clearly how to run them on its satellite projects like refinerycms-blog. Are there instructions for that lurking somewhere?

ugisozols added a commit that referenced this pull request Dec 12, 2011
@ugisozols ugisozols merged commit 7ad876b into refinery:master Dec 12, 2011
@parndt
Copy link
Member

parndt commented Dec 12, 2011

The tests are much easier on rails-3-1 branch which is hopefully shipping any month now ;-) so things will get better soon.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants