Files
astuto/app/models/post_status.rb

17 lines
377 B
Ruby
Raw Normal View History

2019-08-24 12:06:48 +02:00
class PostStatus < ApplicationRecord
2022-07-18 10:47:54 +02:00
include TenantOwnable
include Orderable
2019-09-24 21:16:51 +02:00
has_many :posts, dependent: :nullify
2019-09-18 21:00:38 +02:00
2022-07-18 10:47:54 +02:00
validates :name, presence: true, uniqueness: { scope: :tenant_id }
2019-08-24 12:06:48 +02:00
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
2019-08-24 12:06:48 +02:00
end