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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f104d4ab40d3eed0fa80ea8f7478ceda3392e2c0
4
- data.tar.gz: 4da942a300e3bfada33284dcc7e2c53c1f3e7dc6
3
+ metadata.gz: 34d3864fac5bd100f261d06295299b1d9b08acd3
4
+ data.tar.gz: 41982c65bdea9c3b3aa1160c9ea6bcb2f2232a1d
5
5
  SHA512:
6
- metadata.gz: 944438392a350653aa572612852e475da7d4284cdc2d1a2f28babb2e762ba692da9d6a22c08afaa65df09bf79ac00c254245a813c0906d80fcc780a5bfe4bf3f
7
- data.tar.gz: 6fb231329c1fc52f1e8572496ed0fbb1cbb5009ca93ebc66092175edaa5ade0195d5f3130f08a8ba678a6bd5561205a8e2f32dffa93c8183511c07730c6236a6
6
+ metadata.gz: e842c89b94f099b134ffd915b72142cea017338ba209cb4446ad8ebeaea12c7d1a4e3c50feaf1ac16d5fd6ace5073b252a8c09579aca9850db4551311949e6e3
7
+ data.tar.gz: 7d383004c82e4ea0fad5ea92ac79d28050699774816737c315442532db8ee89437488b074e9b434a4c17bdb23ce4a23c4ec14eb5dac2003555e2d21c37ffddfe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.1.1
2
+
3
+ * (beornborn) use instance_exec for defining scope because @klass sometimes is resolved as nil
4
+
1
5
  # 1.1.0
2
6
 
3
7
  * (itkin) `available_states` and `available_events` should list states or events in the order they are defined
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)
@@ -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.scope state_name, -> { @klass.where(@klass.state_machine.attribute_name => state_name) }
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
@@ -1,3 +1,3 @@
1
1
  module Transitions
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
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.0
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-04-08 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler