Defect #38155 » Make_Redmine_preparation_idempotent.patch
| lib/redmine/access_control.rb | ||
|---|---|---|
|
def permission(name, hash, options={})
|
||
|
@permissions ||= []
|
||
|
@permissions.reject! {|p| p.name == name}
|
||
|
options[:project_module] = @project_module
|
||
|
@permissions << Permission.new(name, hash, options)
|
||
|
end
|
||
| lib/redmine/menu_manager.rb | ||
|---|---|---|
|
target_root = @menu_items.root
|
||
|
end
|
||
|
target_root.children.reject! {|item| item.name == name}
|
||
|
# menu item position
|
||
|
if first = options.delete(:first)
|
||
|
target_root.prepend(MenuItem.new(name, url, options))
|
||
| ... | ... | |
|
# Adds a child at given position
|
||
|
def add_at(child, position)
|
||
|
raise "Child already added" if find {|node| node.name == child.name}
|
||
|
@children = @children.insert(position, child)
|
||
|
child.parent = self
|
||
|
child
|
||
| lib/redmine/plugin.rb | ||
|---|---|---|
|
# Warn for potential settings[:partial] collisions
|
||
|
if p.configurable?
|
||
|
partial = p.settings[:partial]
|
||
|
if @used_partials[partial]
|
||
|
Rails.logger.warn(
|
||
|
"WARNING: settings partial '#{partial}' is declared in '#{p.id}' plugin " \
|
||
|
"but it is already used by plugin '#{@used_partials[partial]}'. " \
|
||
|
"Only one settings view will be used. " \
|
||
|
"You may want to contact those plugins authors to fix this."
|
||
|
)
|
||
|
end
|
||
|
@used_partials[partial] = p.id
|
||
|
end
|
||
| lib/redmine/scm/base.rb | ||
|---|---|---|
|
# Add a new SCM adapter and repository
|
||
|
def add(scm_name)
|
||
|
@scms ||= []
|
||
|
@scms.delete(scm_name)
|
||
|
@scms << scm_name
|
||
|
end
|
||
| lib/redmine/wiki_formatting.rb | ||
|---|---|---|
|
def register(name, *args)
|
||
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
||
|
name = name.to_s
|
||
|
raise ArgumentError, "format name '#{name}' is already taken" if @@formatters[name]
|
||
|
formatter, helper, parser =
|
||
|
if args.any?
|
||