Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix CostObject renaming to Budget in journable_type

Oliver Güntherd53409c75d17
diff --git a/modules/costs/db/migrate/20210726065912_rename_cost_object_type.rb b/modules/costs/db/migrate/20210726065912_rename_cost_object_type.rb
new file mode 100644
index 00000000000..917570765d3
--- /dev/null
+++ b/modules/costs/db/migrate/20210726065912_rename_cost_object_type.rb
@@ -0,0 +1,11 @@
+class RenameCostObjectType < ActiveRecord::Migration[6.1]
+ def up
+ Journal
+ .where(journable_type: 'CostObject')
+ .update_all(journable_type: 'Budget')
+ end
+
+ def down
+ # Doesn't need to be reverted
+ end
+end