diff --git a/modules/bim/app/models/bim/bcf.rb b/modules/bim/app/models/bim/bcf.rb deleted file mode 100644 index 289ff0b711..0000000000 --- a/modules/bim/app/models/bim/bcf.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Bim - module Bcf - def self.table_name_prefix - 'bcf_' - end - end -end diff --git a/modules/bim/app/models/bim/bcf/comment.rb b/modules/bim/app/models/bim/bcf/comment.rb index 9c9bb9cea7..a52180b60a 100644 --- a/modules/bim/app/models/bim/bcf/comment.rb +++ b/modules/bim/app/models/bim/bcf/comment.rb @@ -1,5 +1,7 @@ module Bim::Bcf class Comment < ActiveRecord::Base + self.table_name = :bcf_comments + include InitializeWithUuid belongs_to :journal diff --git a/modules/bim/app/models/bim/bcf/issue.rb b/modules/bim/app/models/bim/bcf/issue.rb index a44434ae82..46f09b71c9 100644 --- a/modules/bim/app/models/bim/bcf/issue.rb +++ b/modules/bim/app/models/bim/bcf/issue.rb @@ -1,5 +1,7 @@ module Bim::Bcf class Issue < ActiveRecord::Base + self.table_name = :bcf_issues + include InitializeWithUuid include ::Concerns::VirtualAttribute diff --git a/modules/bim/app/models/bim/bcf/viewpoint.rb b/modules/bim/app/models/bim/bcf/viewpoint.rb index 165625ac1f..393bd0dde2 100644 --- a/modules/bim/app/models/bim/bcf/viewpoint.rb +++ b/modules/bim/app/models/bim/bcf/viewpoint.rb @@ -1,5 +1,7 @@ module Bim::Bcf class Viewpoint < ActiveRecord::Base + self.table_name = :bcf_viewpoints + include InitializeWithUuid acts_as_attachable view_permission: :view_linked_issues, diff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rb index 181985812b..971b986dc0 100644 --- a/modules/bim/lib/open_project/bim/engine.rb +++ b/modules/bim/lib/open_project/bim/engine.rb @@ -62,7 +62,7 @@ module OpenProject::Bim delete_work_packages] end - OpenProject::AccessControl.permission(:view_work_packages).actions << 'bcf/issues/redirect_to_bcf_issues_list' + OpenProject::AccessControl.permission(:view_work_packages).actions << 'bim/bcf/issues/redirect_to_bcf_issues_list' ::Redmine::MenuManager.map(:project_menu) do |menu| menu.push(:ifc_models, diff --git a/modules/bim/lib/open_project/bim/patches/work_package_patch.rb b/modules/bim/lib/open_project/bim/patches/work_package_patch.rb index 54aebc9e70..fac56af9cc 100644 --- a/modules/bim/lib/open_project/bim/patches/work_package_patch.rb +++ b/modules/bim/lib/open_project/bim/patches/work_package_patch.rb @@ -31,7 +31,7 @@ require_dependency 'work_package' module OpenProject::Bim::Patches::WorkPackagePatch def self.included(base) base.class_eval do - has_one :bcf_issue, class_name: 'Bim::Bcf::Issue', foreign_key: 'work_package_id' + has_one :bcf_issue, class_name: '::Bim::Bcf::Issue', foreign_key: 'work_package_id' end end end