minimal_state_machine 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/minimal_state_machine/version.rb +1 -1
- data/lib/minimal_state_machine.rb +4 -0
- data/spec/minimal_state_machine_spec.rb +4 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -59,9 +59,9 @@ What would happen with this configuration:
|
|
59
59
|
Issue.new.state
|
60
60
|
=> #<IssueState::Open id: nil, type: "IssueState::Open", state_machine_id: nil, state_machine_type: "Issue", created_at: nil, updated_at: nil>
|
61
61
|
|
62
|
-
issue = Issue.
|
63
|
-
issue.save
|
62
|
+
issue = Issue.create
|
64
63
|
issue.state_name = 'closed'
|
64
|
+
issue.save
|
65
65
|
issue.state
|
66
66
|
=> #<IssueState::Closed id: 1, type: "IssueState::Closed", state_machine_id: 1, state_machine_type: "Issue", created_at: "2013-01-03 19:13:31", updated_at: "2013-01-03 19:13:31">
|
67
67
|
```
|
@@ -52,6 +52,10 @@ describe StateMachine do
|
|
52
52
|
@state_machine.state.should be_a(StateMachineClosed)
|
53
53
|
end
|
54
54
|
|
55
|
+
it 'provides a human friendly getter for the state_name' do
|
56
|
+
@state_machine.state_name.should == 'open'
|
57
|
+
end
|
58
|
+
|
55
59
|
it 'destroys the previous state after the transition' do
|
56
60
|
@state_machine.state_name = 'closed'
|
57
61
|
@state_machine.save
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimal_state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|