transitions 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/transitions/machine.rb +3 -1
- data/lib/transitions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34d3864fac5bd100f261d06295299b1d9b08acd3
|
4
|
+
data.tar.gz: 41982c65bdea9c3b3aa1160c9ea6bcb2f2232a1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e842c89b94f099b134ffd915b72142cea017338ba209cb4446ad8ebeaea12c7d1a4e3c50feaf1ac16d5fd6ace5073b252a8c09579aca9850db4551311949e6e3
|
7
|
+
data.tar.gz: 7d383004c82e4ea0fad5ea92ac79d28050699774816737c315442532db8ee89437488b074e9b434a4c17bdb23ce4a23c4ec14eb5dac2003555e2d21c37ffddfe
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -398,6 +398,10 @@ Supported implementations:
|
|
398
398
|
behind this see the Changelog.
|
399
399
|
|
400
400
|
|
401
|
+
### Associated projects
|
402
|
+
|
403
|
+
* [GraphvizTransitions](https://github.com/itkin/graphviz_transitions) - Adds support for generating graphs based on states, events and transitions
|
404
|
+
|
401
405
|
### Documentation, Guides & Examples
|
402
406
|
|
403
407
|
* [Online API Documentation](http://rdoc.info/github/troessner/transitions/master/Transitions)
|
data/lib/transitions/machine.rb
CHANGED
@@ -95,6 +95,7 @@ module Transitions
|
|
95
95
|
(@events[name] ||= Event.new(self, name)).update(options, &block)
|
96
96
|
end
|
97
97
|
|
98
|
+
# :reek:TooManyStatements: { max_statements: 7 }
|
98
99
|
def include_scopes
|
99
100
|
@states.each do |state|
|
100
101
|
state_name = state.name.to_s
|
@@ -103,7 +104,8 @@ module Transitions
|
|
103
104
|
"Transitions: Can not define scope `#{state_name}` because there is already"\
|
104
105
|
'an equally named method defined - either rename the existing method or the state.'
|
105
106
|
end
|
106
|
-
@klass.
|
107
|
+
scope = @klass.instance_exec { -> { where(state_machine.attribute_name => state_name) } }
|
108
|
+
@klass.scope state_name, scope
|
107
109
|
end
|
108
110
|
end
|
109
111
|
end
|
data/lib/transitions/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transitions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Rößner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|