diff --git a/app/models/activity.rb b/app/models/activity.rb index 6042698a..21c547b7 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -33,7 +33,7 @@ class Activity < ApplicationRecord after_save :copy_author_and_group_to_form! def self.categories - %w[algemeen societeit vorming dinsdagkring woensdagkring + %w[algemeen societeit vorming kring choose ifes ozon disputen kiemgroepen huizen extern eerstejaars curiositates] end diff --git a/db/migrate/20241113104056_simplyfing_calender_options.rb b/db/migrate/20241113104056_simplyfing_calender_options.rb new file mode 100644 index 00000000..50f4ef25 --- /dev/null +++ b/db/migrate/20241113104056_simplyfing_calender_options.rb @@ -0,0 +1,17 @@ +class SimplyfingCalenderOptions < ActiveRecord::Migration[7.0] + def up + Activity.where(category: 'dinsdagkring').find_each do |activity| + activity.update(category: 'kring') + end + + Activity.where(category: 'woensdagkring').find_each do |activity| + activity.update(category: 'kring') + end + end + + def down + Activity.where(category: 'kring').find_each do |activity| + activity.update(category: 'dinsdagkring') + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 3c73c96e..c37d2fec 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,8 +9,7 @@ # migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema[7.0].define(version: 2024_11_13_091607) do +ActiveRecord::Schema[7.0].define(version: 2024_11_13_104056) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -474,7 +473,7 @@ t.index ["author_id"], name: "index_polls_on_author_id" t.index ["form_id"], name: "index_polls_on_form_id" end -3 + create_table "room_adverts", force: :cascade do |t| t.string "house_name", null: false t.string "contact", null: false diff --git a/spec/factories/activities.rb b/spec/factories/activities.rb index 5b1c464c..cd6ebeb2 100644 --- a/spec/factories/activities.rb +++ b/spec/factories/activities.rb @@ -10,7 +10,7 @@ start_time { Faker::Time.between(from: 1.day.ago, to: Time.zone.today) } end_time { Faker::Time.between(from: 1.day.from_now, to: 2.days.from_now) } category do - %w[algemeen societeit vorming dinsdagkring woensdagkring + %w[algemeen societeit vorming kring choose ifes ozon disputen kiemgroepen huizen extern eerstejaars curiositates].sample end publicly_visible { false } diff --git a/spec/models/activity_spec.rb b/spec/models/activity_spec.rb index 6a78ce13..e4e387fd 100644 --- a/spec/models/activity_spec.rb +++ b/spec/models/activity_spec.rb @@ -179,7 +179,7 @@ context 'when it is another category' do let(:record) do build_stubbed(:activity, - category: %w[algemeen sociƫteit vorming dinsdagkring woensdagkring + category: %w[algemeen sociƫteit vorming kring disputen kiemgroepen huizen extern curiositates].sample) end