0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 04:48:33 +08:00
discourse/app/models/admin_dashboard_section.rb
Osama Sayegh abcda0f58a
FEATURE: Persist "Activity by category" dashboard filter selection (#41758)
Admins can choose which categories appear in the admin dashboard's
"Activity by category" section. That choice now sticks for everyone
across refreshes instead of resetting to the defaults on each visit.

The selection is stored through a generic per-section settings storage
system. Any dashboard section can declare the settings it supports, so
future section configuration and filters can reuse the same storage,
endpoint, and validation without new plumbing.
2026-07-17 10:54:28 +03:00

24 lines
703 B
Ruby
Vendored

# frozen_string_literal: true
class AdminDashboardSection < ActiveRecord::Base
validates :section_id, presence: true, uniqueness: true
validates :position, presence: true
validates :visible, inclusion: { in: [true, false] }
end
# == Schema Information
#
# Table name: admin_dashboard_sections
#
# id :bigint not null, primary key
# position :integer not null
# settings :jsonb not null
# visible :boolean default(TRUE), not null
# created_at :datetime not null
# updated_at :datetime not null
# section_id :string not null
#
# Indexes
#
# index_admin_dashboard_sections_on_section_id (section_id) UNIQUE
#