activerecord-fsm 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 351276a49e27c515507b1e7857e9a67f554014b0d104f3044b7564ef3c8f1b60
4
- data.tar.gz: b6820092158ca95745e4d4286539b1bb3a2b89995a639415a753cb2815bfedad
3
+ metadata.gz: 84761f9ea0af11ae77b61d5ea2921f6fff0b4b2879146e70ffb95d0145c927cf
4
+ data.tar.gz: 2f08b42c4cd23724bb90f72ad47029eb306557195249cc960b89640759383638
5
5
  SHA512:
6
- metadata.gz: 16bb26cfdd1bea69b4f740e575b7d7c3319e1acce307650fdc999ae1dea86b9477d07b9e3352ec61e7abc13a3b6e688a7ce9f9c7435e691901c5f2cba05c4d25
7
- data.tar.gz: ac6f2bd60084ac177923c03afa8934d90cc7a12709c77b402237f6f3b8e8a19699cbdbdcffaf5af643c6bca95fdfcfc7e70828ccec03dfb2cf2e992d35bbfb6b
6
+ metadata.gz: 57a6e7babcbb80fc24e87011a18c7591e7519bbfba81aa005456304fabdf3457620986fc9910e180f5d15e983e722f7fa8c6b0284ace76cf5339d08f8744f65a
7
+ data.tar.gz: a38d1f3016b03010d8b60369f958609b7d055053aa8a60de36a615c99ff0242b32e3bc535272175ec877644b4e6932b86b31d045bff4a6c66d64f508aa54d14d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-fsm (0.1.2)
4
+ activerecord-fsm (0.1.3)
5
5
  activerecord (>= 5.2, < 7.0)
6
6
  activesupport (>= 5.2, < 7.0)
7
7
 
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # ActiveRecord::Fsm
2
2
 
3
3
  A simple Finite State Machine.
4
- Use this gem to auto define Finite State Machine on ActiveRecord with one column named `status`.
4
+ Use this gem to auto define Finite State Machine on ActiveRecord with one column named `status`.
5
+
6
+ **The goal of this gem is to monitor record with wrong state, and then help us to stats whether or not the code works well.**
7
+ **The next step is to add monitor to FSM, and now it is currently UNDER DEVELOPMENT.**
5
8
 
6
9
  ## Installation
7
10
 
@@ -57,7 +60,7 @@ class ApplicationRecord < ActiveRecord::Base
57
60
  include ActiveRecord::Fsm
58
61
 
59
62
  self.abstract_class = true
60
- # blabalbla......
63
+ # blablabla......
61
64
  end
62
65
 
63
66
  # FsmModel need call fsm_define
@@ -6,7 +6,7 @@ module ActiveRecord
6
6
  def initialize(transitions)
7
7
  @transitions = transitions
8
8
  @states = transitions.flatten.uniq
9
- @final_states = transitions.map(&:last) - transitions.map(&:first)
9
+ @final_states = (transitions.map(&:last) - transitions.map(&:first)).uniq
10
10
  end
11
11
 
12
12
  def valid_transition?(cur_state, tar_state)
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Fsm
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-fsm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ElliotCui