mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
18 lines
430 B
Ruby
18 lines
430 B
Ruby
class PostStatus < ApplicationRecord
|
|
include TenantOwnable
|
|
include Orderable
|
|
|
|
has_many :posts, dependent: :nullify
|
|
has_many :post_status_changes, dependent: :destroy
|
|
|
|
validates :name, presence: true, uniqueness: { scope: :tenant_id }
|
|
validates :color, format: { with: /\A#(?:[0-9a-fA-F]{3}){1,2}\z/ }
|
|
|
|
class << self
|
|
def find_roadmap
|
|
where(show_in_roadmap: true)
|
|
.order(order: :asc)
|
|
end
|
|
end
|
|
end
|