transitions 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.7
2
+
3
+ * (cmw) Better prevention of name clashes when creating initializer methods
4
+
1
5
  # 1.0.6
2
6
 
3
7
  * (troessner) Revert 'Fixing set_initial_state with Mongoid' because of https://github.com/troessner/transitions/issues/76
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?(:new_initialize) || instance_methods.include?(:new_update)
29
+ unless instance_methods.include?(:new_transitions_initialize) || instance_methods.include?(:new_transitions_update)
30
30
  attr_reader :attribute_name
31
- alias :old_initialize :initialize
32
- alias :old_update :update
31
+ alias :old_transitions_initialize :initialize
32
+ alias :old_transitions_update :update
33
33
 
34
- def new_initialize(*args, &block)
34
+ def new_transitions_initialize(*args, &block)
35
35
  @attribute_name = :state
36
- old_initialize(*args, &block)
36
+ old_transitions_initialize(*args, &block)
37
37
  end
38
38
 
39
- def new_update(options = {}, &block)
39
+ def new_transitions_update(options = {}, &block)
40
40
  @attribute_name = options[:attribute_name] if options.key?(:attribute_name)
41
- old_update(options, &block)
41
+ old_transitions_update(options, &block)
42
42
  end
43
43
 
44
- alias :initialize :new_initialize
45
- alias :update :new_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
@@ -1,3 +1,3 @@
1
1
  module Transitions
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
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.6
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-02-28 00:00:00.000000000 Z
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: -1024202641
182
+ hash: 316655379
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  none: false
185
185
  requirements: