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: Inflection issues for attributes with `ifc_` in the name.

Wieland Lindenthal7ebe6022f77b
diff --git a/modules/bcf/lib/open_project/bcf/bcf_xml/viewpoint_writer.rb b/modules/bcf/lib/open_project/bcf/bcf_xml/viewpoint_writer.rb
index fd089b6952f..d0a3b0ab634 100644
--- a/modules/bcf/lib/open_project/bcf/bcf_xml/viewpoint_writer.rb
+++ b/modules/bcf/lib/open_project/bcf/bcf_xml/viewpoint_writer.rb
@@ -161,7 +161,11 @@ module OpenProject::Bcf::BcfXml
##
# Helper to transform a hash into camelized keys
def camelized(hash)
- hash.transform_keys(&:camelize)
+ hash.transform_keys do |key|
+ # `camelize` uses the inflections of ActiveSupport. There we defined inflections for `IFC`. However, here we
+ # don't want that applied here. `ifc_foo` shall be converted to `IfcFoo` and not to `IFCFoo`.
+ key.camelize.gsub(/IFC/, 'Ifc')
+ end
end
##