transitions 0.1.7 → 0.1.8
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
CHANGED
data/lib/transitions/machine.rb
CHANGED
|
@@ -102,7 +102,7 @@ module Transitions
|
|
|
102
102
|
if @klass.respond_to?(state_name)
|
|
103
103
|
raise InvalidMethodOverride, "Transitions: Can not define scope `#{state_name}` because there is already an equally named method defined - either rename the existing method or the state."
|
|
104
104
|
end
|
|
105
|
-
@klass.scope state_name, @klass.where(
|
|
105
|
+
@klass.scope state_name, @klass.where(@klass.state_machine.attribute_name => state_name)
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
end
|
data/lib/transitions/version.rb
CHANGED
|
@@ -19,7 +19,7 @@ end
|
|
|
19
19
|
class CreateBunnies < ActiveRecord::Migration
|
|
20
20
|
def self.up
|
|
21
21
|
create_table(:bunnies, :force => true) do |t|
|
|
22
|
-
t.string :state
|
|
22
|
+
t.string :status # Explicitly use another state column to ensure that this whole enchilada is working with other state column names than the default ones.
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -29,7 +29,7 @@ set_up_db CreateBunnies, CreatePuppies
|
|
|
29
29
|
class Bunny < ActiveRecord::Base
|
|
30
30
|
include ActiveModel::Transitions
|
|
31
31
|
|
|
32
|
-
state_machine :auto_scopes => true do
|
|
32
|
+
state_machine :attribute_name => :status, :auto_scopes => true do
|
|
33
33
|
state :hobbling
|
|
34
34
|
end
|
|
35
35
|
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.
|
|
4
|
+
version: 0.1.8
|
|
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-03-
|
|
13
|
+
date: 2013-03-14 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: 604342113
|
|
183
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
none: false
|
|
185
185
|
requirements:
|