Merge pull request #8076 from opf/bim/fix-seeding

Avoid seeding bim unless configuration set in patches
pull/8078/head
Henriette Dinger 5 years ago committed by GitHub
commit 3e307bb56c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      modules/bim/lib/open_project/bim/patches/project_seeder_patch.rb
  2. 7
      modules/bim/lib/open_project/bim/patches/root_seeder_patch.rb

@ -5,10 +5,16 @@ module OpenProject::Bim::Patches::ProjectSeederPatch
module InstanceMethods module InstanceMethods
def project_data_seeders(project, key) def project_data_seeders(project, key)
[ data = super
::Bim::DemoData::BcfXmlSeeder.new(project, key),
::Bim::DemoData::IfcModelSeeder.new(project, key) if OpenProject::Configuration.bim?
] + super(project, key) [
::Bim::DemoData::BcfXmlSeeder.new(project, key),
::Bim::DemoData::IfcModelSeeder.new(project, key)
] + data
else
data
end
end end
def seed_settings def seed_settings

@ -5,7 +5,12 @@ module OpenProject::Bim::Patches::RootSeederPatch
module InstanceMethods module InstanceMethods
def seed_basic_data def seed_basic_data
::Bim::BasicDataSeeder.new.seed! if OpenProject::Configuration.bim?
puts "*** Seeding basic data for bim edition"
::Bim::BasicDataSeeder.new.seed!
else
super
end
end end
end end
end end

Loading…
Cancel
Save