Sha256: 20f5b95312e86027ef8cbd0a08b2f2089f2742f905eeca2694d0baebf4ef05a9

Contents?: true

Size: 1.48 KB

Versions: 12

Compression:

Stored size: 1.48 KB

Contents

require 'aasm'

# The following patches can be removed once the following PR has been merged into AASM:
#   https://github.com/aasm/aasm/pull/269

AASM::Core::Event
module AASM::Core
  class Event
    def initialize_copy(orig)
      super
      @transitions = @transitions.collect { |transition| transition.clone }
      @guards      = @guards.dup
      @unless      = @unless.dup
      @options     = {}
      orig.options.each_pair { |name, setting| @options[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? setting.dup : setting }
    end
  end
end

AASM::Core::State
module AASM::Core
  class State
    # called internally by Ruby 1.9 after clone()
    def initialize_copy(orig)
      super
      @options = {}
      orig.options.each_pair { |name, setting| @options[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? setting.dup : setting }
    end
  end
end

AASM::Core::Transition
module AASM::Core
  class Transition
    def initialize_copy(orig)
      super
      @guards = @guards.dup
      @unless = @unless.dup
      @opts   = {}
      orig.opts.each_pair { |name, setting| @opts[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? setting.dup : setting }
    end
  end
end

AASM::StateMachine
module AASM
  class StateMachine
    def initialize_copy(orig)
      super
      @states = orig.states.collect { |state| state.clone }
      @events = {}
      orig.events.each_pair { |name, event| @events[name] = event.clone }
      @global_callbacks = @global_callbacks.dup
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rocketjob-3.0.0.rc5 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.rc4 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.rc3 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.rc2 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.rc1 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.beta3 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.beta2 lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.beta lib/rocket_job/extensions/aasm.rb
rocketjob-3.0.0.alpha lib/rocket_job/extensions/aasm.rb
rocketjob-2.1.3 lib/rocket_job/extensions/aasm.rb
rocketjob-2.1.2 lib/rocket_job/extensions/aasm.rb
rocketjob-2.1.1 lib/rocket_job/extensions/aasm.rb