DEV: Switch over category settings to new table - Part 2 (#20580)

In #20135 we prevented invalid inputs from being accepted in category setting form fields on the front-end. We didn't do anything on the back-end at that time, because we were still discussing which path we wanted to take. Eventually we decided we want to move this to a new CategorySetting model.

This PR moves the num_auto_bump_daily from custom fields to the new CategorySetting model.

In addition it sets the default value to 0, which exhibits the same behaviour as when the value is NULL.
This commit is contained in:
Ted Johansson
2023-08-04 10:53:22 +08:00
committed by GitHub
parent 0fb86e6dc1
commit 1f7e5e8e75
7 changed files with 83 additions and 32 deletions

View File

@ -411,7 +411,7 @@ class CategoriesController < ApplicationController
:read_only_banner,
:default_list_filter,
:reviewable_by_group_id,
category_setting_attributes: %i[auto_bump_cooldown_days],
category_setting_attributes: %i[auto_bump_cooldown_days num_auto_bump_daily],
custom_fields: [custom_field_params],
permissions: [*p.try(:keys)],
allowed_tags: [],