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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -2
- data/lib/activerecord/fsm/graph.rb +1 -1
- data/lib/activerecord/fsm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84761f9ea0af11ae77b61d5ea2921f6fff0b4b2879146e70ffb95d0145c927cf
|
4
|
+
data.tar.gz: 2f08b42c4cd23724bb90f72ad47029eb306557195249cc960b89640759383638
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57a6e7babcbb80fc24e87011a18c7591e7519bbfba81aa005456304fabdf3457620986fc9910e180f5d15e983e722f7fa8c6b0284ace76cf5339d08f8744f65a
|
7
|
+
data.tar.gz: a38d1f3016b03010d8b60369f958609b7d055053aa8a60de36a615c99ff0242b32e3bc535272175ec877644b4e6932b86b31d045bff4a6c66d64f508aa54d14d
|
data/Gemfile.lock
CHANGED
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
|
-
#
|
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)
|