argon 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/argon.rb +3 -3
- data/lib/argon/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: 60fd885d7f5c4e1caa00a91bb59d07265798a30d
|
4
|
+
data.tar.gz: a6ce77e8ea5c78ffc1717087a2574ba575ead97e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 581d6143a5276a7c1b919d37ac24e7c03972bddeae4d647abadc0fad6e187c8f5ee920cf5add90b61ebff96cf37f06627840112a8b020302b6a138241cf1ad1d
|
7
|
+
data.tar.gz: 0f24080de7277bb93d4da19156233ed27bf7887339e37b1d2c934a12148ea231cdc0d2ea4eec58cfe6fc230f476b5809b73c05596b7ea6fba4c646dce014394e
|
data/lib/argon.rb
CHANGED
@@ -163,13 +163,13 @@ module Argon
|
|
163
163
|
if on_failed_transition
|
164
164
|
self.on_failed_transition(field: field, action: action, from: from, to: to)
|
165
165
|
end
|
166
|
-
raise Argon::InvalidTransitionError.new("Invalid state transition")
|
166
|
+
raise Argon::InvalidTransitionError.new("Invalid state transition. #{ self.class.name }##{ self.send(self.class.primary_key.to_sym) } cannot perform '#{action}' on #{field}='#{from}'")
|
167
167
|
end
|
168
168
|
|
169
169
|
begin
|
170
170
|
self.with_lock do
|
171
171
|
if self.send(field) != from
|
172
|
-
raise Argon::InvalidTransitionError.new("Invalid state transition")
|
172
|
+
raise Argon::InvalidTransitionError.new("Invalid state transition. #{ self.class.name }##{ self.send(self.class.primary_key.to_sym) } cannot perform '#{action}' on #{field}='#{from}'")
|
173
173
|
end
|
174
174
|
|
175
175
|
self.update_column(field, self.class.send("#{ field.to_s.pluralize }").map{|v| [v[0],v[1]]}.to_h[to])
|
@@ -230,7 +230,7 @@ module Argon
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
|
233
|
-
raise Argon::InvalidTransitionError.new("No valid transitions")
|
233
|
+
raise Argon::InvalidTransitionError.new("No valid transitions for #{ self.class.name }##{ self.send(self.class.primary_key.to_sym) }##{ field }")
|
234
234
|
end
|
235
235
|
end
|
236
236
|
end
|
data/lib/argon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: argon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajith Hussain
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|