mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Code cleanup: RuboCop: Fix Style/UnneededCondition in app/models/setting.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18397 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
47dd2083f7
commit
26774d09e9
@ -1830,7 +1830,6 @@ Style/UnneededCondition:
|
||||
- 'app/controllers/messages_controller.rb'
|
||||
- 'app/controllers/previews_controller.rb'
|
||||
- 'app/models/issue.rb'
|
||||
- 'app/models/setting.rb'
|
||||
|
||||
# Cop supports --auto-correct.
|
||||
Style/UnneededInterpolation:
|
||||
|
||||
@ -107,13 +107,12 @@ class Setting < ActiveRecord::Base
|
||||
|
||||
# Returns the value of the setting named name
|
||||
def self.[](name)
|
||||
v = @cached_settings[name]
|
||||
v ? v : (@cached_settings[name] = find_or_default(name).value)
|
||||
@cached_settings[name] ||= find_or_default(name).value
|
||||
end
|
||||
|
||||
def self.[]=(name, v)
|
||||
setting = find_or_default(name)
|
||||
setting.value = (v ? v : "")
|
||||
setting.value = v || ''
|
||||
@cached_settings[name] = nil
|
||||
setting.save
|
||||
setting.value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user