drop settings_compatible which was used for Redmine 3.x compatiblitiy, fix coding standards for rubocop update
This commit is contained in:
parent
e4a1ddb60e
commit
68f5aae4f8
@ -70,3 +70,6 @@ Style/HashTransformKeys:
|
||||
|
||||
Style/HashTransformValues:
|
||||
Enabled: false
|
||||
|
||||
Naming/VariableNumber:
|
||||
Enabled: false
|
||||
|
@ -106,23 +106,19 @@ module AdditionalsQuery
|
||||
end
|
||||
|
||||
def initialize_author_filter(options = {})
|
||||
return if author_values.empty?
|
||||
|
||||
add_available_filter('author_id', order: options[:position],
|
||||
type: :list_optional,
|
||||
values: options[:no_lambda].nil? ? author_values : -> { author_values })
|
||||
end
|
||||
|
||||
def initialize_assignee_filter(options = {})
|
||||
return if author_values.empty?
|
||||
|
||||
add_available_filter('assigned_to_id', order: options[:position],
|
||||
type: :list_optional,
|
||||
values: options[:no_lambda] ? assigned_to_all_values : -> { assigned_to_all_values })
|
||||
end
|
||||
|
||||
def initialize_watcher_filter(options = {})
|
||||
return if watcher_values.empty? || !User.current.logged?
|
||||
return unless User.current.logged?
|
||||
|
||||
add_available_filter('watcher_id', order: options[:position],
|
||||
type: :list,
|
||||
|
@ -66,18 +66,6 @@ module Additionals
|
||||
recently_updated reddit slideshare tradingview twitter user vimeo youtube asciinema]
|
||||
end
|
||||
|
||||
def settings_compatible(plugin_name)
|
||||
if Setting[plugin_name].is_a? Hash
|
||||
# convert Rails 4 data (this runs only once)
|
||||
new_settings = ActiveSupport::HashWithIndifferentAccess.new Setting[plugin_name]
|
||||
Setting.send "#{plugin_name}=", new_settings
|
||||
new_settings
|
||||
else
|
||||
# Rails 5 uses ActiveSupport::HashWithIndifferentAccess
|
||||
Setting[plugin_name]
|
||||
end
|
||||
end
|
||||
|
||||
# support with default setting as fall back
|
||||
def setting(value)
|
||||
if settings.key? value
|
||||
@ -161,7 +149,7 @@ module Additionals
|
||||
private
|
||||
|
||||
def settings
|
||||
settings_compatible :plugin_additionals
|
||||
Setting[:plugin_additionals]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user