mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 17:15:32 +08:00
a90ad52dff
This is the first in a multi-part change to move the custom fields to a new table. It includes: - Adding a new CategorySetting model and corresponding table. - Populating it with data from the category_custom_fields table.
29 lines
755 B
Ruby
29 lines
755 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CategorySetting < ActiveRecord::Base
|
|
belongs_to :category
|
|
|
|
validates :num_auto_bump_daily,
|
|
numericality: {
|
|
only_integer: true,
|
|
greater_than_or_equal_to: 0,
|
|
allow_nil: true,
|
|
}
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: category_settings
|
|
#
|
|
# id :bigint not null, primary key
|
|
# category_id :bigint not null
|
|
# require_topic_approval :boolean
|
|
# require_reply_approval :boolean
|
|
# num_auto_bump_daily :integer
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
# Indexes
|
|
#
|
|
# index_category_settings_on_category_id (category_id) UNIQUE
|
|
#
|