Skip to content

Commit d3ddd09

Browse files
committed
introduces plugin setting for name of unit custom field
- after deploying the new code, in a console, run Setting.plugin_redmine_supply = Setting.plugin_redmine_supply.merge("unit_cf" => "New Name Of Custom Field") - restart server and the renamed unit custom field will be recognized
1 parent 78740ea commit d3ddd09

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

init.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
requires_redmine version_or_higher: '3.4.0'
1616

17+
settings default: {
18+
"unit_cf" => "Unit"
19+
}
20+
1721
project_module :supply do
1822

1923
permission :manage_supply_items, {

lib/redmine_supply.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def self.setup
1414
end
1515

1616
def self.unit_cf
17-
SupplyItemCustomField.find_by_name 'Unit'
17+
name = Setting.plugin_redmine_supply["unit_cf"].presence || "Unit"
18+
SupplyItemCustomField.find_by_name name
1819
end
1920
end

0 commit comments

Comments
 (0)