Sha256: 242b6c7c58b8d9cb1953669cb2e5de15581e5553101275b4bdb563b8f03b5a86

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 Bytes

Contents

module RailsWorkflow
  class OperationDecorator < OperationHelperDecorator
    delegate_all
    decorates_association :template, with: OperationTemplateDecorator


    def context
      ContextDecorator.decorate object.context
    end

    def process
      object.process.decorate
    end

    def async
      object.async ? "Yes" : "No"
    end

    def is_background
      object.is_background ? "Yes": "No"
    end

    def child_process
      if object.child_process
        ::RailsWorkflow::ProcessDecorator.decorate(object.child_process)
      end
    end

    def show_dependencies
      if object.dependencies.present?
        object.dependencies.map do |dependency|
          Operation.find(dependency['operation_id']).decorate
        end
      else
        []
      end

    end


    def show_template_dependencies
      template.show_dependencies
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.3.7 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.6 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.5 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.4 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.3 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.2 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.1 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.3.0 app/decorators/rails_workflow/operation_decorator.rb
rails_workflow-0.2.2 app/decorators/rails_workflow/operation_decorator.rb