argon 1.2.0 → 1.3.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/argon.rb +3 -3
  3. data/lib/argon/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b09160785840c5182b6b589f4d5f54b0d63195a1
4
- data.tar.gz: 5a41ae363e257e607726e453304da872849546b2
3
+ metadata.gz: 60fd885d7f5c4e1caa00a91bb59d07265798a30d
4
+ data.tar.gz: a6ce77e8ea5c78ffc1717087a2574ba575ead97e
5
5
  SHA512:
6
- metadata.gz: a1f0d95b2405e163b88c8a07f7636fe9150fe8be919220ed97505efc1cc8bbe7d5dd3aff08cfc26c16960c6410703b1c1246e209699971e2d8afd76eae79ac5b
7
- data.tar.gz: a6ff9a9fc30fafc0f44e9b4c7be3ddcbef2493f04c8b4878f13a5ac68b5deee39942396f6ef4f20cd1ca5df84d996a6db9543cf5894c78e2096a07be0f07f56d
6
+ metadata.gz: 581d6143a5276a7c1b919d37ac24e7c03972bddeae4d647abadc0fad6e187c8f5ee920cf5add90b61ebff96cf37f06627840112a8b020302b6a138241cf1ad1d
7
+ data.tar.gz: 0f24080de7277bb93d4da19156233ed27bf7887339e37b1d2c934a12148ea231cdc0d2ea4eec58cfe6fc230f476b5809b73c05596b7ea6fba4c646dce014394e
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Argon
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
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.2.0
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-05-01 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler