Sha256: 0565a5a3dbe2c7949a141b66906bd08f0750a8c8c99a6fc9aacc6de765230bfa

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'active_support/concern'

module RailsWorkflow
  module Operations
    # = Workflow::ProcessTemplate::Dependenceis
    #
    # Operation dependencies is a set of conditions. Operation can be build if all that
    # dependenceis / conditions are satisfied. This is default implementation of dependenceis
    # which used to build operation dependency on other operations. You can customize dependency
    # for example you can add some additional logic depending on existiong processes / operations
    # or other conditions in your system.
    #

    module Dependencies
      extend ActiveSupport::Concern

      included do
        serialize :dependencies, JSON

        # def dependencies=(dependencies)
        #   write_attribute(:dependencies, dependencies.to_json.to_s)
        # end
        #
        # def dependencies
        #   value = read_attribute(:dependencies)
        #   if value.present?
        #     JSON.parse(value)
        #   else
        #     []
        #   end
        # end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.7.2 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.7.1 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.7.0 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.4.4 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.4.3 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.4.2 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.4.1 app/concerns/rails_workflow/operations/dependencies.rb
rails_workflow-0.4.0 app/concerns/rails_workflow/operations/dependencies.rb