]> source.dussan.org Git - redmine.git/commitdiff
Remove unnecessary use of instance variables in CSV and Atom response handlers (...
authorGo MAEDA <maeda@farend.jp>
Wed, 24 Jan 2024 02:49:38 +0000 (02:49 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 24 Jan 2024 02:49:38 +0000 (02:49 +0000)
Contributed by Ko Nagase (@sanak).

git-svn-id: https://svn.redmine.org/redmine/trunk@22622 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/boards_controller.rb
app/controllers/issues_controller.rb
app/controllers/projects_controller.rb
app/controllers/timelog_controller.rb
app/controllers/users_controller.rb

index bd9b88f766b07a59a4c6b7f07610fbab6afce2b7..43de1d0777d9df480d387c31433f7523059abe19 100644 (file)
@@ -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
index 8b95a8c59eb2af000a6465ada5ef37506ddd5923..d823975ae99530d9a73b3ebd08c209c0eede587b 100644 (file)
@@ -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
index 15e9120f8664de0cfd73b4eb8313182bdecbfddd..b67d01b7bc0ab23028c15a404034d961fb5d97f6 100644 (file)
@@ -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
index f6859597afc200faab8d514faff64df7495ab954..ad7ee4c703e969b11acec22eee550062b92460bd 100644 (file)
@@ -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
index 067564bd32d9ef9fec31b0c444275f27c13c70b0..74e111de65fbc32168cae21964f12b9afeceecf8 100644 (file)
@@ -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