Sha256: facedd5971f9f6473ba9beb3dfb04172c173f38d2b10ca3ee2737d818d3a73ee

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module RailsWorkflow
  module HasContext
    extend ActiveSupport::Concern

    included do
      has_one :context, class_name: 'RailsWorkflow::Context', as: :parent
      
      after_save :save_context
      def save_context
        context&.save
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 app/concerns/rails_workflow/has_context.rb
rails_workflow-0.7.2 app/concerns/rails_workflow/has_context.rb
rails_workflow-0.7.1 app/concerns/rails_workflow/has_context.rb
rails_workflow-0.7.0 app/concerns/rails_workflow/has_context.rb
rails_workflow-0.4.4 app/concerns/rails_workflow/has_context.rb