aasm 5.0.3 → 5.0.4
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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/Appraisals +11 -2
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/gemfiles/rails_5.0.gemfile +1 -1
- data/gemfiles/rails_5.1.gemfile +1 -1
- data/gemfiles/rails_5.2.gemfile +13 -0
- data/lib/aasm/base.rb +6 -15
- data/lib/aasm/version.rb +1 -1
- data/spec/models/active_record/person.rb +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 537b11c8aadc0b6418e70147aadfaf3d22b396de
|
4
|
+
data.tar.gz: 276ec751af17ec10f441a932b45f487a0fa6ade6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b0378d3262cb3aabcff3ad438c8cf06ae5e1b87d139e8612eac1c8146fd97c08ea17f425a23e42d2fa7ef1d1c48c58362168450db1026022b3b943df01ddc8
|
7
|
+
data.tar.gz: f2daffa37e70cbbb89e17d1182a9017633f5554cb78ea4bff94c1f6ba51fb50f01330badd3a82cd6890683f5522322fd2b0ea3cde63a0444980566e4b040bc2b
|
data/.travis.yml
CHANGED
@@ -28,6 +28,7 @@ gemfile:
|
|
28
28
|
- gemfiles/rails_5.0.gemfile
|
29
29
|
- gemfiles/rails_5.0_nobrainer.gemfile
|
30
30
|
- gemfiles/rails_5.1.gemfile
|
31
|
+
- gemfiles/rails_5.2.gemfile
|
31
32
|
|
32
33
|
before_script:
|
33
34
|
- mkdir /tmp/dynamodb
|
@@ -47,6 +48,8 @@ matrix:
|
|
47
48
|
gemfile: gemfiles/rails_5.0_nobrainer.gemfile
|
48
49
|
- rvm: 2.3.0
|
49
50
|
gemfile: gemfiles/rails_5.1.gemfile
|
51
|
+
- rvm: 2.3.0
|
52
|
+
gemfile: gemfiles/rails_5.2.gemfile
|
50
53
|
- rvm: 2.5.0
|
51
54
|
gemfile: gemfiles/rails_3.2.gemfile
|
52
55
|
- rvm: 2.5.0
|
@@ -59,6 +62,8 @@ matrix:
|
|
59
62
|
gemfile: gemfiles/rails_5.0.gemfile
|
60
63
|
- rvm: jruby-9.1.12.0
|
61
64
|
gemfile: gemfiles/rails_5.1.gemfile
|
65
|
+
- rvm: jruby-9.1.12.0
|
66
|
+
gemfile: gemfiles/rails_5.2.gemfile
|
62
67
|
- rvm: jruby-9.1.12.0
|
63
68
|
gemfile: gemfiles/rails_4.2_nobrainer.gemfile
|
64
69
|
- rvm: jruby-9.1.12.0
|
data/Appraisals
CHANGED
@@ -36,7 +36,7 @@ appraise 'rails_5.0' do
|
|
36
36
|
gem 'rails', '5.0.0'
|
37
37
|
gem 'mongoid', '~> 6.0'
|
38
38
|
gem 'sequel'
|
39
|
-
gem 'dynamoid', '~> 1', platforms: :ruby
|
39
|
+
gem 'dynamoid', '~> 1.3', platforms: :ruby
|
40
40
|
gem 'aws-sdk', '~> 2', platforms: :ruby
|
41
41
|
gem 'redis-objects'
|
42
42
|
end
|
@@ -50,7 +50,16 @@ appraise 'rails_5.1' do
|
|
50
50
|
gem 'rails', '5.1'
|
51
51
|
gem 'mongoid', '~>6.0'
|
52
52
|
gem 'sequel'
|
53
|
-
gem 'dynamoid', '~> 1', platforms: :ruby
|
53
|
+
gem 'dynamoid', '~> 1.3', platforms: :ruby
|
54
|
+
gem 'aws-sdk', '~>2', platforms: :ruby
|
55
|
+
gem 'redis-objects'
|
56
|
+
end
|
57
|
+
|
58
|
+
appraise 'rails_5.2' do
|
59
|
+
gem 'rails', '5.2'
|
60
|
+
gem 'mongoid', '~>6.0'
|
61
|
+
gem 'sequel'
|
62
|
+
gem 'dynamoid', '~>2.2', platforms: :ruby
|
54
63
|
gem 'aws-sdk', '~>2', platforms: :ruby
|
55
64
|
gem 'redis-objects'
|
56
65
|
end
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
## unreleased
|
4
4
|
|
5
|
+
## 5.0.4
|
6
|
+
|
7
|
+
* Specify dynamoid version for Rails > 5, [#625](https://github.com/aasm/aasm/pull/625),
|
8
|
+
thanks to [waghanza](https://github.com/waghanza)
|
9
|
+
* Add travis runner for Rails 5.2, [#624](https://github.com/aasm/aasm/pull/624), thanks
|
10
|
+
to [waghanza](https://github.com/waghanza)
|
11
|
+
* Cleanup Abstract class issue, [#620](https://github.com/aasm/aasm/pull/620), thanks to
|
12
|
+
[dennym](https://github.com/dennym)
|
13
|
+
|
5
14
|
## 5.0.3
|
6
15
|
|
7
16
|
* Fix Abstract class issue, [#619](https://github.com/aasm/aasm/pull/619)
|
data/README.md
CHANGED
@@ -219,7 +219,7 @@ Also, you can pass parameters to events:
|
|
219
219
|
|
220
220
|
In this case the `set_process` would be called with `:defragmentation` argument.
|
221
221
|
|
222
|
-
Note that when passing arguments to a state transition, the first argument
|
222
|
+
Note that when passing arguments to a state transition, the first argument should be the desired end state. In the above example, we wish to transition to `:running` state and run the callback with `:defragmentation` argument. You can also omit or pass in `nil` as the desired end state, and AASM will try to transition to the first end state defined for that event.
|
223
223
|
|
224
224
|
In case of an error during the event processing the error is rescued and passed to `:error`
|
225
225
|
callback, which can handle it or re-raise it for further propagation.
|
data/gemfiles/rails_5.0.gemfile
CHANGED
data/gemfiles/rails_5.1.gemfile
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "sqlite3", "~> 1.3.5", platforms: :ruby
|
6
|
+
gem "rails", "5.2"
|
7
|
+
gem "mongoid", "~>6.0"
|
8
|
+
gem "sequel"
|
9
|
+
gem "dynamoid", "~>2.2", platforms: :ruby
|
10
|
+
gem "aws-sdk", "~>2", platforms: :ruby
|
11
|
+
gem "redis-objects"
|
12
|
+
|
13
|
+
gemspec path: "../"
|
data/lib/aasm/base.rb
CHANGED
@@ -54,25 +54,16 @@ module AASM
|
|
54
54
|
# make sure to raise an error if no_direct_assignment is enabled
|
55
55
|
# and attribute is directly assigned though
|
56
56
|
aasm_name = @name
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
'direct assignment of AASM column has been disabled (see AASM configuration for this class)'
|
62
|
-
|
63
|
-
else
|
64
|
-
super(state_name)
|
57
|
+
|
58
|
+
if @state_machine.config.no_direct_assignment
|
59
|
+
@klass.send(:define_method, "#{@state_machine.config.column}=") do |state_name|
|
60
|
+
if self.class.aasm(:"#{aasm_name}").state_machine.config.no_direct_assignment
|
61
|
+
raise AASM::NoDirectAssignmentError.new('direct assignment of AASM column has been disabled (see AASM configuration for this class)')
|
62
|
+
end
|
65
63
|
end
|
66
64
|
end
|
67
65
|
end
|
68
66
|
|
69
|
-
def should_not_define_method(klass)
|
70
|
-
(klass.methods.include?(:abstract_class) &&
|
71
|
-
klass.abstract_class) ||
|
72
|
-
(klass.superclass.methods.include?(:abstract_class) &&
|
73
|
-
klass.superclass.abstract_class)
|
74
|
-
end
|
75
|
-
|
76
67
|
# This method is both a getter and a setter
|
77
68
|
def attribute_name(column_name=nil)
|
78
69
|
if column_name
|
data/lib/aasm/version.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
class Base < ActiveRecord::Base
|
2
|
-
self.abstract_class = true
|
3
|
-
self.table_name = 'users'
|
4
|
-
|
5
2
|
include AASM
|
6
3
|
|
7
4
|
aasm column: 'status' do
|
@@ -16,6 +13,9 @@ class Base < ActiveRecord::Base
|
|
16
13
|
transitions from: :active, to: :inactive
|
17
14
|
end
|
18
15
|
end
|
16
|
+
|
17
|
+
self.abstract_class = true
|
18
|
+
self.table_name = 'users'
|
19
19
|
end
|
20
20
|
|
21
21
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Boettger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- gemfiles/rails_5.0.gemfile
|
145
145
|
- gemfiles/rails_5.0_nobrainer.gemfile
|
146
146
|
- gemfiles/rails_5.1.gemfile
|
147
|
+
- gemfiles/rails_5.2.gemfile
|
147
148
|
- lib/aasm.rb
|
148
149
|
- lib/aasm/aasm.rb
|
149
150
|
- lib/aasm/base.rb
|