Add a new "creating" state
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user