Sha256: 0b53674509e75bbae2db924ff77cdb6a1b10453c1037c8cb8918d871ce426592

Contents?: true

Size: 519 Bytes

Versions: 46

Compression:

Stored size: 519 Bytes

Contents

class UserReserveStatStateMachine
  include Statesman::Machine
  state :pending, initial: true
  state :started
  state :completed

  transition from: :pending, to: :started
  transition from: :started, to: :completed

  after_transition(to: :started) do |user_reserve_stat|
    user_reserve_stat.update_column(:started_at, Time.zone.now)
    user_reserve_stat.calculate_count!
  end

  after_transition(to: :completed) do |user_reserve_stat|
    user_reserve_stat.update_column(:completed_at, Time.zone.now)
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
enju_circulation-0.3.11 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.10 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.9 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.4.0.rc.1 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.8 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.7 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.4.0.beta.4 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.4.0.beta.3 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.6 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.4.0.beta.2 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.4.0.beta.1 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.5 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.4 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.3 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.2 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.1 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.0 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.0.rc.1 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.3.0.beta.1 app/models/user_reserve_stat_state_machine.rb
enju_circulation-0.2.5 app/models/user_reserve_stat_state_machine.rb