From f70edc02f086d97727453e738e9f0083c68ec706 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 9 Jul 2018 20:26:37 +0100 Subject: [PATCH] Return the "large" image from the user details API call Closes #1923 --- app/helpers/user_helper.rb | 2 +- app/views/user/api_read.builder | 2 +- test/helpers/user_helper_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 27d6faa8c..065a562c4 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -38,7 +38,7 @@ module UserHelper if user.image_use_gravatar user_gravatar_url(user, options) else - image_url(user.image.url) + image_url(user.image.url(:large)) end end diff --git a/app/views/user/api_read.builder b/app/views/user/api_read.builder index 4ed8c9e94..e9cebd5ae 100644 --- a/app/views/user/api_read.builder +++ b/app/views/user/api_read.builder @@ -10,7 +10,7 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do else xml.tag! "contributor-terms", :agreed => @user.terms_agreed.present? end - xml.tag! "img", :href => user_image_url(@user, :size => 256) if @user.image.file? || @user.image_use_gravatar + xml.tag! "img", :href => user_image_url(@user) if @user.image.file? || @user.image_use_gravatar xml.tag! "roles" do @user.roles.each do |role| xml.tag! role.role diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index eedc8775c..c57299a96 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -59,7 +59,7 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) url = user_image_url(user) - assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/original/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url + assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/large/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url url = user_image_url(gravatar_user) assert_match %r{^http://www.gravatar.com/avatar/}, url -- 2.39.5