]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Layout/EmptyLinesAroundBlockBody in app/models/attachment.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 30 Sep 2019 08:59:54 +0000 (08:59 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 30 Sep 2019 08:59:54 +0000 (08:59 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18558 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/attachment.rb

index d8e0e1fc68640fdcebb35db7ae80137e21af4014..5408d3ea0fbcdf79d0ecbb19e6ae255934c6c481 100644 (file)
@@ -180,7 +180,6 @@ Layout/EmptyLinesAroundArguments:
 # SupportedStyles: empty_lines, no_empty_lines
 Layout/EmptyLinesAroundBlockBody:
   Exclude:
-    - 'app/models/attachment.rb'
     - 'app/models/setting.rb'
     - 'db/schema.rb'
     - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
index a334024b43b7d6ecb86098b5be6d2db13a6962d6..29d1acc792d934684ada2284e0a4ae1e9e083a13 100644 (file)
@@ -427,7 +427,6 @@ class Attachment < ActiveRecord::Base
 
   def reuse_existing_file_if_possible
     original_diskfile = nil
-
     reused = with_lock do
       if existing = Attachment
                       .where(digest: self.digest, filesize: self.filesize)
@@ -435,14 +434,11 @@ class Attachment < ActiveRecord::Base
                              self.id, self.disk_filename)
                       .first
         existing.with_lock do
-
           original_diskfile = self.diskfile
           existing_diskfile = existing.diskfile
-
           if File.readable?(original_diskfile) &&
             File.readable?(existing_diskfile) &&
             FileUtils.identical?(original_diskfile, existing_diskfile)
-
             self.update_columns disk_directory: existing.disk_directory,
                                 disk_filename: existing.disk_filename
           end
@@ -459,7 +455,6 @@ class Attachment < ActiveRecord::Base
     # anymore, thats why this is caught and ignored as well.
   end
 
-
   # Physically deletes the file from the file system
   def delete_from_disk!
     if disk_filename.present? && File.exist?(diskfile)