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

Make the IFC Models module a default for new models

Wieland Lindenthal8ee0f7aedb70
diff --git a/modules/ifc_models/lib/open_project/ifc_models/engine.rb b/modules/ifc_models/lib/open_project/ifc_models/engine.rb
index 76a1633faac..acf8e1cd5d2 100644
--- a/modules/ifc_models/lib/open_project/ifc_models/engine.rb
+++ b/modules/ifc_models/lib/open_project/ifc_models/engine.rb
@@ -75,5 +75,6 @@ module OpenProject::IFCModels
end
patches %i[Project]
+ patch_with_namespace :BasicData, :SettingSeeder
end
end
diff --git a/modules/ifc_models/lib/open_project/ifc_models/patches/setting_seeder_patch.rb b/modules/ifc_models/lib/open_project/ifc_models/patches/setting_seeder_patch.rb
new file mode 100644
index 00000000000..5046ac782ef
--- /dev/null
+++ b/modules/ifc_models/lib/open_project/ifc_models/patches/setting_seeder_patch.rb
@@ -0,0 +1,45 @@
+#-- copyright
+# OpenProject is a project management system.
+# Copyright (C) 2012-2019 the OpenProject Foundation (OPF)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2017 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See docs/COPYRIGHT.rdoc for more details.
+#++
+
+module OpenProject::IFCModels::Patches::SettingSeederPatch
+ def self.included(base) # :nodoc:
+ base.prepend InstanceMethods
+ end
+
+ module InstanceMethods
+ def data
+ original_data = super
+
+ unless original_data['default_projects_modules'].include? 'ifc_models'
+ original_data['default_projects_modules'] << 'ifc_models'
+ end
+
+ original_data
+ end
+ end
+end