Files
fizzy/app/models/bubble/draftable.rb
T
2025-01-15 10:58:00 +00:00

10 lines
244 B
Ruby

module Bubble::Draftable
extend ActiveSupport::Concern
included do
enum :status, %w[ drafted published ].index_by(&:itself)
scope :published_or_drafted_by, ->(user) { where(status: :published).or(where(creator: user)) }
end
end