discourse/app/models/category_setting.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1007 B
Ruby
Raw Normal View History

# 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,
}
validates :auto_bump_cooldown_days,
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
# auto_bump_cooldown_days :integer default(1)
# Indexes
#
# index_category_settings_on_category_id (category_id) UNIQUE
#