|
|
|
@ -30,14 +30,12 @@ module DemoData |
|
|
|
|
# Careful: The seeding recreates the seeded project before it runs, so any changes |
|
|
|
|
# on the seeded project will be lost. |
|
|
|
|
def seed_data! |
|
|
|
|
# We are relying on the default_projects_modules setting to set the desired project modules |
|
|
|
|
puts ' ↳ Creating demo project...' |
|
|
|
|
|
|
|
|
|
puts ' -Creating/Resetting Demo project' |
|
|
|
|
project = reset_demo_project |
|
|
|
|
|
|
|
|
|
puts ' -Setting modules.' |
|
|
|
|
set_modules(project) |
|
|
|
|
|
|
|
|
|
puts ' -Setting members.' |
|
|
|
|
set_members(project) |
|
|
|
|
|
|
|
|
@ -84,11 +82,6 @@ module DemoData |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def set_modules(project) |
|
|
|
|
project.enabled_module_names += ['timelines'] |
|
|
|
|
project.enabled_module_names -= ['repository'] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def set_members(project) |
|
|
|
|
role = Role.find_by(name: I18n.t(:default_role_project_admin)) |
|
|
|
|
user = User.admin.first |
|
|
|
|