problem fixed for migration from redmine 3.x to redmine 4
This commit is contained in:
parent
3731a12fdd
commit
62d7f321ce
@ -6,6 +6,7 @@ Changelog
|
||||
|
||||
- Performance improvement (#36)
|
||||
- FontAwesome 5.6.3 support
|
||||
- Fix problem from migrating from Redmine 3.x to Redmine 4 with lost settings
|
||||
|
||||
2.0.17
|
||||
++++++
|
||||
|
@ -56,10 +56,18 @@ module Additionals
|
||||
end
|
||||
|
||||
def settings
|
||||
if Rails.version >= '5.2'
|
||||
Setting[:plugin_additionals]
|
||||
if Setting[:plugin_additionals].class == Hash
|
||||
if Rails.version >= '5.2'
|
||||
# convert Rails 4 data
|
||||
new_settings = ActiveSupport::HashWithIndifferentAccess.new(Setting[:plugin_additionals])
|
||||
Setting.plugin_additionals = new_settings
|
||||
new_settings
|
||||
else
|
||||
ActionController::Parameters.new(Setting[:plugin_additionals])
|
||||
end
|
||||
else
|
||||
ActionController::Parameters.new(Setting[:plugin_additionals])
|
||||
# Rails 5 uses ActiveSupport::HashWithIndifferentAccess
|
||||
Setting[:plugin_additionals]
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user