gravatar_enabled = gravatar_enable(current_user)
if current_user.save
flash[:notice] = if gravatar_enabled
- t("users.confirm_email.success") + " " + gravatar_status_message(current_user)
+ "#{t('users.confirm_email.success')} #{gravatar_status_message(current_user)}"
else
t("users.confirm_email.success")
end
##
# omniauth failure callback
def auth_failure
- flash[:error] = t("users.auth_failure." + params[:message])
+ flash[:error] = t("users.auth_failure.#{params[:message]}")
redirect_to params[:origin] || login_url
end
if referer.nil?
params[:origin] = request.path
else
- params[:origin] = request.path + "?referer=" + CGI.escape(referer)
+ params[:origin] = "#{request.path}?referer=#{CGI.escape(referer)}"
params[:referer] = referer
end
user.languages = params[:user][:languages].split(",")
case params[:avatar_action]
- when "new" then
+ when "new"
user.avatar.attach(params[:user][:avatar])
user.image_use_gravatar = false
- when "delete" then
+ when "delete"
user.avatar.purge_later
user.image_use_gravatar = false
- when "gravatar" then
+ when "gravatar"
user.avatar.purge_later
user.image_use_gravatar = true
end