diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-10-11 12:57:39 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-10-11 12:57:39 +0000 |
commit | 834bc11cc91f6ea4ad66daf7dc5d0683b0b8eb90 (patch) | |
tree | bf3a42a25c95fafe02dc6e2a3ae3813f8cdb97e7 /app/controllers/application_controller.rb | |
parent | d55582dccf911e31eefa964182073f45b745274f (diff) | |
download | redmine-834bc11cc91f6ea4ad66daf7dc5d0683b0b8eb90.tar.gz redmine-834bc11cc91f6ea4ad66daf7dc5d0683b0b8eb90.zip |
use "do end" instead of {} at ApplicationController
git-svn-id: http://svn.redmine.org/redmine/trunk@20142 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c08a238bd..219165627 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -259,23 +259,23 @@ class ApplicationController < ActionController::Base url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id]) end respond_to do |format| - format.html { + format.html do if request.xhr? head :unauthorized else redirect_to signin_path(:back_url => url) end - } - format.any(:atom, :pdf, :csv) { + end + format.any(:atom, :pdf, :csv) do redirect_to signin_path(:back_url => url) - } - format.api { + end + format.api do if Setting.rest_api_enabled? && accept_api_auth? head(:unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"') else head(:forbidden) end - } + end format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' } format.any { head :unauthorized } end @@ -562,9 +562,9 @@ class ApplicationController < ActionController::Base @status = arg[:status] || 500 respond_to do |format| - format.html { + format.html do render :template => 'common/error', :layout => use_layout, :status => @status - } + end format.any { head @status } end end @@ -675,13 +675,13 @@ class ApplicationController < ActionController::Base tmp = [] if value parts = value.split(/,\s*/) - parts.each {|part| + parts.each do |part| if m = %r{^([^\s,]+?)(?:;\s*q=(\d+(?:\.\d+)?))?$}.match(part) val = m[1] q = (m[2] or 1).to_f tmp.push([val, q]) end - } + end tmp = tmp.sort_by{|val, q| -q} tmp.collect!{|val, q| val} end |