mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
Remove unnecessary use of instance variables in CSV and Atom response handlers (#32985).
Contributed by Ko Nagase (@sanak). git-svn-id: https://svn.redmine.org/redmine/trunk@22622 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -56,12 +56,12 @@ class BoardsController < ApplicationController
|
||||
render :action => 'show', :layout => !request.xhr?
|
||||
end
|
||||
format.atom do
|
||||
@messages = @board.messages.
|
||||
messages = @board.messages.
|
||||
reorder(:id => :desc).
|
||||
includes(:author, :board).
|
||||
limit(Setting.feeds_limit.to_i).
|
||||
to_a
|
||||
render_feed(@messages, :title => "#{@project}: #{@board}")
|
||||
render_feed(messages, :title => "#{@project}: #{@board}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,13 +67,13 @@ class IssuesController < ApplicationController
|
||||
end
|
||||
end
|
||||
format.atom do
|
||||
@issues = @query.issues(:limit => Setting.feeds_limit.to_i)
|
||||
render_feed(@issues,
|
||||
issues = @query.issues(:limit => Setting.feeds_limit.to_i)
|
||||
render_feed(issues,
|
||||
:title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}")
|
||||
end
|
||||
format.csv do
|
||||
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
||||
send_data(query_to_csv(@issues, @query, params[:csv]),
|
||||
issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
||||
send_data(query_to_csv(issues, @query, params[:csv]),
|
||||
:type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'issues')}.csv")
|
||||
end
|
||||
format.pdf do
|
||||
|
||||
@@ -77,8 +77,8 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
format.csv do
|
||||
# Export all entries
|
||||
@entries = scope.to_a
|
||||
send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'projects.csv')
|
||||
entries = scope.to_a
|
||||
send_data(query_to_csv(entries, @query, params), :type => 'text/csv; header=present', :filename => 'projects.csv')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,8 +66,8 @@ class TimelogController < ApplicationController
|
||||
end
|
||||
format.csv do
|
||||
# Export all entries
|
||||
@entries = scope.to_a
|
||||
send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'timelog')}.csv")
|
||||
entries = scope.to_a
|
||||
send_data(query_to_csv(entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'timelog')}.csv")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,8 +73,8 @@ class UsersController < ApplicationController
|
||||
end
|
||||
format.csv do
|
||||
# Export all entries
|
||||
@entries = scope.to_a
|
||||
send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'users')}.csv")
|
||||
entries = scope.to_a
|
||||
send_data(query_to_csv(entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'users')}.csv")
|
||||
end
|
||||
format.api do
|
||||
@offset, @limit = api_offset_and_limit
|
||||
|
||||
Reference in New Issue
Block a user