Files
astuto/app/models/post_status.rb

16 lines
336 B
Ruby
Raw Normal View History

2019-08-24 12:06:48 +02:00
class PostStatus < ApplicationRecord
include Orderable
2019-09-24 21:16:51 +02:00
has_many :posts, dependent: :nullify
2019-09-18 21:00:38 +02:00
2019-08-24 12:06:48 +02:00
validates :name, presence: true, uniqueness: true
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