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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove WeekDaySeeder
Dombi Attila292c8d8b482d
diff --git a/app/seeders/basic_data/week_day_seeder.rb b/app/seeders/basic_data/week_day_seeder.rbdeleted file mode 100644index 81d98bd2858..00000000000--- a/app/seeders/basic_data/week_day_seeder.rb+++ /dev/null@@ -1,58 +0,0 @@-#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2022 the OpenProject GmbH-#-# 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-2013 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 COPYRIGHT and LICENSE files for more details.-#++-module BasicData- class WeekDaySeeder < Seeder- def seed_data!- WeekDay.transaction do- days.each do |attributes|- WeekDay.create!(attributes)- end- end- end-- def applicable?- WeekDay.none?- end-- def not_applicable_message- 'Skipping week days as there are already some configured'- end-- def days- [- { day: 1, working: true },- { day: 2, working: true },- { day: 3, working: true },- { day: 4, working: true },- { day: 5, working: true },- { day: 6, working: false },- { day: 7, working: false }- ]- end- end-enddiff --git a/app/seeders/standard_seeder/basic_data_seeder.rb b/app/seeders/standard_seeder/basic_data_seeder.rbindex 06a404f24b6..4ca670082c1 100644--- a/app/seeders/standard_seeder/basic_data_seeder.rb+++ b/app/seeders/standard_seeder/basic_data_seeder.rb@@ -31,7 +31,6 @@ module StandardSeeder[::BasicData::BuiltinRolesSeeder,::BasicData::RoleSeeder,- ::BasicData::WeekDaySeeder,::StandardSeeder::BasicData::ActivitySeeder,::BasicData::ColorSeeder,::BasicData::ColorSchemeSeeder,diff --git a/spec/seeders/week_day_seeder_spec.rb b/spec/seeders/week_day_seeder_spec.rbdeleted file mode 100644index fc26f1c11e4..00000000000--- a/spec/seeders/week_day_seeder_spec.rb+++ /dev/null@@ -1,52 +0,0 @@-#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2022 the OpenProject GmbH-#-# 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-2013 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 COPYRIGHT and LICENSE files for more details.-#++--require 'spec_helper'--describe ::BasicData::WeekDaySeeder do- subject { described_class.new }-- before do- subject.seed!- end-- def reseed!- subject.seed!- end-- it 'creates the initial days' do- WeekDay.destroy_all- expect { reseed! }.to change { WeekDay.pluck(:day, :working) }- .from([])- .to([[1, true], [2, true], [3, true], [4, true], [5, true], [6, false], [7, false]])- end-- it 'does not override existing days' do- expect { reseed! }.not_to change { WeekDay.pluck(:day, :working) }- end-end