2023-02-12 22:37:59 -06:00
|
|
|
# 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,
|
|
|
|
}
|
2023-03-09 23:45:01 -06:00
|
|
|
|
|
|
|
validates :auto_bump_cooldown_days,
|
|
|
|
numericality: {
|
|
|
|
only_integer: true,
|
|
|
|
greater_than_or_equal_to: 0,
|
|
|
|
allow_nil: true,
|
|
|
|
}
|
2023-02-12 22:37:59 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: category_settings
|
|
|
|
#
|
2023-03-09 23:45:01 -06:00
|
|
|
# id :bigint not null, primary key
|
|
|
|
# category_id :bigint not null
|
2023-09-11 20:51:49 -05:00
|
|
|
# require_topic_approval :boolean default(FALSE)
|
|
|
|
# require_reply_approval :boolean default(FALSE)
|
2023-08-03 21:53:22 -05:00
|
|
|
# num_auto_bump_daily :integer default(0)
|
2023-03-09 23:45:01 -06:00
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# auto_bump_cooldown_days :integer default(1)
|
2023-02-12 22:37:59 -06:00
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_category_settings_on_category_id (category_id) UNIQUE
|
|
|
|
#
|