transitions 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.rdoc +10 -1
- data/lib/transitions.rb +1 -1
- data/lib/transitions/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/README.rdoc
CHANGED
@@ -51,7 +51,7 @@ If this is not the case for you you have to add
|
|
51
51
|
|
52
52
|
whereever you load your dependencies in your application.
|
53
53
|
|
54
|
-
<b>
|
54
|
+
<b>Known limitations:</b>
|
55
55
|
|
56
56
|
* You can only use one state machine per model. While in theory you can define two or more, this won't work as you would expect. Not supporting this was intentional, if you're interested in the ratione look up version 1.0.0 in the CHANGELOG.
|
57
57
|
|
@@ -59,6 +59,15 @@ whereever you load your dependencies in your application.
|
|
59
59
|
|
60
60
|
=== Features
|
61
61
|
|
62
|
+
==== Getting and setting the current state
|
63
|
+
|
64
|
+
Use the (surprise ahead) `current_state` method - in case you didn't set a state explicitly you'll get back the state that you defined as initial state.
|
65
|
+
|
66
|
+
>> Product.new.current_state
|
67
|
+
=> :available
|
68
|
+
|
69
|
+
You can also set a new state explicitly via `update_current_state(new_state, persist = true / false)` but you should never do this unless you really know what you're doing and why - rather use events / state transitions (see below).
|
70
|
+
|
62
71
|
==== Events
|
63
72
|
|
64
73
|
When you declare an event, say <tt>discontinue</tt>, three methods are declared for
|
data/lib/transitions.rb
CHANGED
data/lib/transitions/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transitions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-10-
|
13
|
+
date: 2012-10-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
segments:
|
181
181
|
- 0
|
182
|
-
hash: -
|
182
|
+
hash: -465074797
|
183
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
184
|
none: false
|
185
185
|
requirements:
|