transitions 0.1.6 → 0.1.7
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.
- data/CHANGELOG.md +4 -0
- data/README.rdoc +5 -0
- data/lib/active_model/transitions.rb +9 -11
- data/lib/transitions/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/README.rdoc
CHANGED
@@ -200,6 +200,11 @@ To use a different column than <tt>state</tt> to track it's value simply do this
|
|
200
200
|
end
|
201
201
|
end
|
202
202
|
|
203
|
+
=== Known bugs / limitations
|
204
|
+
|
205
|
+
- Right now it seems like `transitions` does not play well with `mongoid`. A possible fix had to be rolled back due to other side effects: https://github.com/troessner/transitions/issues/76. Since I know virtually zero about mongoid, a pull request would be highly appreciated.
|
206
|
+
- Multiple state machines are and will not be supported. For the rationale behind this see the Changelog.
|
207
|
+
|
203
208
|
=== Documentation, Guides & Examples
|
204
209
|
|
205
210
|
- {Online API Documentation}[http://rdoc.info/github/troessner/transitions/master/Transitions]
|
@@ -26,25 +26,23 @@ module ActiveModel
|
|
26
26
|
|
27
27
|
included do
|
28
28
|
class ::Transitions::Machine
|
29
|
-
unless instance_methods.include?(:
|
29
|
+
unless instance_methods.include?(:new_transitions_initialize) || instance_methods.include?(:new_transitions_update)
|
30
30
|
attr_reader :attribute_name
|
31
|
-
alias :
|
32
|
-
alias :
|
31
|
+
alias :old_transitions_initialize :initialize
|
32
|
+
alias :old_transitions_update :update
|
33
33
|
|
34
|
-
def
|
34
|
+
def new_transitions_initialize(*args, &block)
|
35
35
|
@attribute_name = :state
|
36
|
-
|
36
|
+
old_transitions_initialize(*args, &block)
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def new_transitions_update(options = {}, &block)
|
40
40
|
@attribute_name = options[:attribute_name] if options.key?(:attribute_name)
|
41
|
-
|
41
|
+
old_transitions_update(options, &block)
|
42
42
|
end
|
43
43
|
|
44
|
-
alias :initialize :
|
45
|
-
alias :update :
|
46
|
-
else
|
47
|
-
puts "WARNING: Transitions::Machine#new_update or Transitions::Machine#new_initialize already defined. This can possibly break ActiveModel::Transitions."
|
44
|
+
alias :initialize :new_transitions_initialize
|
45
|
+
alias :update :new_transitions_update
|
48
46
|
end
|
49
47
|
end
|
50
48
|
include ::Transitions
|
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.7
|
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: 2013-
|
13
|
+
date: 2013-03-07 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: 316655379
|
183
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
184
|
none: false
|
185
185
|
requirements:
|