cequel_stateful_enum 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c8d9928e15b1a39df8e5543bbfc523646dc053e
4
- data.tar.gz: ca4affebdadb8ee1f33097065bbb8c91c137b63b
3
+ metadata.gz: 4002b66bd606fc5646179bcd053a6d466f9a64dc
4
+ data.tar.gz: ff1294f37ea2e247056e40831e62cc02a3db68c3
5
5
  SHA512:
6
- metadata.gz: bcda6c95928be784f60b052049d4ab782f0d27b4076a6904a78761d3a7a46f1897b904264555afe4ea2fb02d7ae4a6a65fbd5da38a269fdbc8a5c387af2f6171
7
- data.tar.gz: 8b6f6c5608fd130b0fb25b01446564d6289787ed9b19f55c9c1b7716c1ad1814e29eb74c11d0169f0d7ddc02eee10872956aff285c179379e8661cd80a7dc9cf
6
+ metadata.gz: 99e33a907d0930f0ba19748e8f02659f4159384586f686f6d0212ff115c8f1d6f2188e662a32cb49fee180c71d67b2f63bdd0088ca9a3a0631a390f253fe515e
7
+ data.tar.gz: 4a541d78cbc7baed8f58fdb749478f4674b126b29e4889696b521b0bfd73d0a527c5dc82900c9b68ff5419a8f96e34a2af8c0e6db3e5cb8e43e33b58d0fd8138
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'cequel_stateful_enum'
6
- spec.version = '1.1.0'
6
+ spec.version = '1.1.1'
7
7
  spec.authors = ['Xanders', 'Akira Matsuda']
8
8
  spec.email = ['necropolis@inbox.ru', 'ronnie@dio.jp']
9
9
 
@@ -52,7 +52,12 @@ module CequelStatefulEnum
52
52
  end
53
53
 
54
54
  define_method can do |danger: false|
55
- from = send(column).to_sym
55
+ from = send(column)
56
+ unless from.kind_of?(String) || from.kind_of?(Symbol)
57
+ raise StateError, "can't fire #{name} event from unknown state #{from.inspect}" if danger
58
+ return false
59
+ end
60
+ from = from.to_sym
56
61
  to, condition = transitions[from]
57
62
  if !to
58
63
  raise StateError, "can't fire #{name} event from state #{from}" if danger
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel_stateful_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xanders
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-27 00:00:00.000000000 Z
12
+ date: 2017-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cequel