mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 23:36:01 +01:00
code cleanup: rubocop: fix Layout/IndentationConsistency in app/models/attachment.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18640 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -286,7 +286,6 @@ Layout/IndentHeredoc:
|
|||||||
# SupportedStyles: normal, indented_internal_methods
|
# SupportedStyles: normal, indented_internal_methods
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/attachment.rb'
|
|
||||||
- 'test/helpers/application_helper_test.rb'
|
- 'test/helpers/application_helper_test.rb'
|
||||||
- 'test/integration/api_test/custom_fields_attribute_test.rb'
|
- 'test/integration/api_test/custom_fields_attribute_test.rb'
|
||||||
- 'test/mocks/open_id_authentication_mock.rb'
|
- 'test/mocks/open_id_authentication_mock.rb'
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ class Attachment < ActiveRecord::Base
|
|||||||
def file=(incoming_file)
|
def file=(incoming_file)
|
||||||
unless incoming_file.nil?
|
unless incoming_file.nil?
|
||||||
@temp_file = incoming_file
|
@temp_file = incoming_file
|
||||||
if @temp_file.respond_to?(:original_filename)
|
if @temp_file.respond_to?(:original_filename)
|
||||||
self.filename = @temp_file.original_filename
|
self.filename = @temp_file.original_filename
|
||||||
self.filename.force_encoding("UTF-8")
|
self.filename.force_encoding("UTF-8")
|
||||||
end
|
end
|
||||||
if @temp_file.respond_to?(:content_type)
|
if @temp_file.respond_to?(:content_type)
|
||||||
self.content_type = @temp_file.content_type.to_s.chomp
|
self.content_type = @temp_file.content_type.to_s.chomp
|
||||||
end
|
end
|
||||||
self.filesize = @temp_file.size
|
self.filesize = @temp_file.size
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user