]> source.dussan.org Git - redmine.git/commitdiff
use "do end" instead of {} at TimelogController
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 5 Oct 2020 15:48:39 +0000 (15:48 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 5 Oct 2020 15:48:39 +0000 (15:48 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20132 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/timelog_controller.rb

index bbb25d081ea91c1a74677f893973a78706d9da5e..0107af3a0d0456c2fa0bc45ee21117dc5a3d4eb5 100644 (file)
@@ -47,27 +47,27 @@ class TimelogController < ApplicationController
       preload(:project, :user)
 
     respond_to do |format|
-      format.html {
+      format.html do
         @entry_count = scope.count
         @entry_pages = Paginator.new @entry_count, per_page_option, params['page']
         @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a
 
         render :layout => !request.xhr?
-      }
-      format.api  {
+      end
+      format.api do
         @entry_count = scope.count
         @offset, @limit = api_offset_and_limit
         @entries = scope.offset(@offset).limit(@limit).preload(:custom_values => :custom_field).to_a
-      }
-      format.atom {
+      end
+      format.atom do
         entries = scope.limit(Setting.feeds_limit.to_i).reorder("#{TimeEntry.table_name}.created_on DESC").to_a
         render_feed(entries, :title => l(:label_spent_time))
-      }
-      format.csv {
+      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 => 'timelog.csv')
-      }
+      end
     end
   end
 
@@ -117,7 +117,7 @@ class TimelogController < ApplicationController
 
     if @time_entry.save
       respond_to do |format|
-        format.html {
+        format.html do
           flash[:notice] = l(:notice_successful_create)
           if params[:continue]
             options = {
@@ -139,7 +139,7 @@ class TimelogController < ApplicationController
           else
             redirect_back_or_default project_time_entries_path(@time_entry.project)
           end
-        }
+        end
         format.api do
           render :action => 'show', :status => :created, :location => time_entry_url(@time_entry)
         end
@@ -163,10 +163,10 @@ class TimelogController < ApplicationController
 
     if @time_entry.save
       respond_to do |format|
-        format.html {
+        format.html do
           flash[:notice] = l(:notice_successful_update)
           redirect_back_or_default project_time_entries_path(@time_entry.project)
-        }
+        end
         format.api  { render_api_ok }
       end
     else
@@ -237,21 +237,21 @@ class TimelogController < ApplicationController
     end
 
     respond_to do |format|
-      format.html {
+      format.html do
         if destroyed
           flash[:notice] = l(:notice_successful_delete)
         else
           flash[:error] = l(:notice_unable_delete_time_entry)
         end
         redirect_back_or_default project_time_entries_path(@projects.first), :referer => true
-      }
-      format.api  {
+      end
+      format.api do
         if destroyed
           render_api_ok
         else
           render_validation_errors(@time_entries)
         end
-      }
+      end
     end
   end