Sha256: f80ac3f6d4846d8363e1783c57415960adb8360fdbe5c1402e1b4c45a25c4ea1
Contents?: true
Size: 665 Bytes
Versions: 8
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true require_dependency 'redmine_plugins_helper/available' module RedminePluginsHelper class Settings class << self def default(plugin, default) return unless ::RedminePluginsHelper::Available.settings? p = plugin_current_setting_value(plugin) default.each do |k, v| p[k.to_s] = v unless p.key?(k) end ::Setting.send("plugin_#{plugin}=", p) end private def plugin_current_setting_value(plugin) p = ::Setting.send("plugin_#{plugin}") p = {} unless p.is_a?(::Hash) p = p.with_indifferent_access p end end end end
Version data entries
8 entries across 8 versions & 1 rubygems