aasm 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/lib/aasm.rb +4 -5
  2. data/lib/event.rb +3 -3
  3. metadata +2 -3
  4. data/lib/version.rb +0 -0
@@ -5,7 +5,7 @@ require File.join(File.dirname(__FILE__), 'persistence')
5
5
 
6
6
  module AASM
7
7
  def self.Version
8
- '2.0.5'
8
+ '2.0.6'
9
9
  end
10
10
 
11
11
  class InvalidTransition < RuntimeError
@@ -15,12 +15,11 @@ module AASM
15
15
  end
16
16
 
17
17
  def self.included(base) #:nodoc:
18
- # TODO - need to ensure that a machine is being created because
19
- # AASM was either included or arrived at via inheritance. It
20
- # cannot be both.
21
18
  base.extend AASM::ClassMethods
22
19
  AASM::Persistence.set_persistence(base)
23
- AASM::StateMachine[base] = AASM::StateMachine.new('')
20
+ unless AASM::StateMachine[base]
21
+ AASM::StateMachine[base] = AASM::StateMachine.new('')
22
+ end
24
23
  end
25
24
 
26
25
  module ClassMethods
@@ -34,11 +34,11 @@ module AASM
34
34
 
35
35
  def execute_success_callback(obj)
36
36
  case success
37
- when String, Symbol:
37
+ when String, Symbol
38
38
  obj.send(success)
39
- when Array:
39
+ when Array
40
40
  success.each { |meth| obj.send(meth) }
41
- when Proc:
41
+ when Proc
42
42
  success.call(obj)
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Barron
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-22 03:00:00 -05:00
12
+ date: 2009-05-16 03:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -37,7 +37,6 @@ files:
37
37
  - lib/state.rb
38
38
  - lib/state_machine.rb
39
39
  - lib/state_transition.rb
40
- - lib/version.rb
41
40
  - doc/jamis.rb
42
41
  has_rdoc: true
43
42
  homepage: http://github.com/rubyist/aasm
File without changes