Add a new "creating" state

This commit is contained in:
Kevin McConnell
2025-02-06 14:16:02 +00:00
parent 5107071315
commit b347d77f4d
4 changed files with 21 additions and 9 deletions
+2 -2
View File
@@ -2,9 +2,9 @@ module Bubble::Draftable
extend ActiveSupport::Concern
included do
enum :status, %w[ drafted published ].index_by(&:itself)
enum :status, %w[ creating drafted published ].index_by(&:itself)
scope :published_or_drafted_by, ->(user) { where(status: :published).or(where(creator: user)) }
scope :published_or_drafted_by, ->(user) { where(status: :published).or(where(status: :drafted, creator: user)) }
end
def publish