Don't bother with this for now
This commit is contained in:
@@ -16,15 +16,4 @@ class Account < ApplicationRecord
|
||||
has_many :tags, dependent: :destroy
|
||||
|
||||
has_many_attached :uploads
|
||||
|
||||
after_create :create_default_workflow
|
||||
|
||||
private
|
||||
def create_default_workflow
|
||||
workflows.create!(name: "Default Workflow").tap do |workflow|
|
||||
[ "Triage", "In progress", "On Hold", "Review" ].each do |name|
|
||||
workflow.stages.create!(name: name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,19 +10,11 @@ class Bucket < ApplicationRecord
|
||||
|
||||
validates_presence_of :name
|
||||
|
||||
after_create :ensure_workflow_exists
|
||||
after_save :update_bubbles_workflow, if: :saved_change_to_workflow_id?
|
||||
|
||||
scope :alphabetically, -> { order(name: :asc) }
|
||||
|
||||
private
|
||||
def ensure_workflow_exists
|
||||
unless account.workflows.exists?
|
||||
workflow = account.workflows.create!(name: "Default Workflow")
|
||||
[ "Triage", "In progress", "Oh Hold", "Review" ].each { |name| workflow.stages.create!(name: name) }
|
||||
end
|
||||
end
|
||||
|
||||
def update_bubbles_workflow
|
||||
if workflow
|
||||
first_stage = workflow.stages.first
|
||||
|
||||
Reference in New Issue
Block a user