mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-05 00:33:04 +00:00
code cleanup: rubocop: fix Lint/UselessAccessModifier in app/models/changeset.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18607 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
eee75cf080
commit
af67ade563
@ -591,11 +591,6 @@ Lint/UriEscapeUnescape:
|
|||||||
- 'lib/redmine/scm/adapters/subversion_adapter.rb'
|
- 'lib/redmine/scm/adapters/subversion_adapter.rb'
|
||||||
- 'test/functional/wiki_controller_test.rb'
|
- 'test/functional/wiki_controller_test.rb'
|
||||||
|
|
||||||
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
|
|
||||||
Lint/UselessAccessModifier:
|
|
||||||
Exclude:
|
|
||||||
- 'app/models/changeset.rb'
|
|
||||||
|
|
||||||
Lint/UselessAssignment:
|
Lint/UselessAssignment:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
|||||||
@ -284,14 +284,15 @@ class Changeset < ActiveRecord::Base
|
|||||||
return @short_comments, @long_comments
|
return @short_comments, @long_comments
|
||||||
end
|
end
|
||||||
|
|
||||||
public
|
# singleton class are public
|
||||||
|
class << self
|
||||||
|
# Strips and reencodes a commit log before insertion into the database
|
||||||
|
def normalize_comments(str, encoding)
|
||||||
|
Changeset.to_utf8(str.to_s.strip, encoding)
|
||||||
|
end
|
||||||
|
|
||||||
# Strips and reencodes a commit log before insertion into the database
|
def to_utf8(str, encoding)
|
||||||
def self.normalize_comments(str, encoding)
|
Redmine::CodesetUtil.to_utf8(str, encoding)
|
||||||
Changeset.to_utf8(str.to_s.strip, encoding)
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def self.to_utf8(str, encoding)
|
|
||||||
Redmine::CodesetUtil.to_utf8(str, encoding)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user