concerned_states 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/concerned_states.gemspec +1 -1
- data/lib/concerned_states/stateable.rb +32 -14
- metadata +3 -3
data/concerned_states.gemspec
CHANGED
@@ -2,21 +2,21 @@ module ConcernedStates
|
|
2
2
|
module Stateable
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
ERRORED = "errored"
|
5
|
+
PASSIVE = "passive"
|
6
|
+
PENDING = "pending"
|
7
|
+
DECLINED = "declined"
|
8
|
+
APPROVED = "approved"
|
9
|
+
ACTIVE = "active"
|
10
|
+
FLAGGED = "flagged"
|
11
|
+
SUSPENDED = "suspended"
|
12
|
+
DELETED = "deleted"
|
13
|
+
STARTED = "started"
|
14
|
+
PAUSED = "paused"
|
15
|
+
CANCELLED = "cancelled"
|
16
|
+
COMPLETED = "completed"
|
17
|
+
ERRORED = "errored"
|
19
18
|
|
19
|
+
included do
|
20
20
|
scope :passive,
|
21
21
|
where(:state => PASSIVE)
|
22
22
|
|
@@ -32,11 +32,29 @@ module ConcernedStates
|
|
32
32
|
scope :active,
|
33
33
|
where(:state => ACTIVE)
|
34
34
|
|
35
|
+
scope :flagged,
|
36
|
+
where(:state => FLAGGED)
|
37
|
+
|
38
|
+
scope :suspended,
|
39
|
+
where(:state => SUSPENDED)
|
40
|
+
|
35
41
|
scope :deleted,
|
36
42
|
where(:state => DELETED)
|
37
43
|
|
44
|
+
scope :started,
|
45
|
+
where(:state => STARTED)
|
46
|
+
|
47
|
+
scope :paused,
|
48
|
+
where(:state => PAUSED)
|
49
|
+
|
50
|
+
scope :cancelled,
|
51
|
+
where(:state => CANCELLED)
|
52
|
+
|
38
53
|
scope :completed,
|
39
54
|
where(:state => COMPLETED)
|
55
|
+
|
56
|
+
scope :errored,
|
57
|
+
where(:state => ERRORED)
|
40
58
|
end
|
41
59
|
|
42
60
|
def passivate; self.state = PASSIVE; end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerned_states
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Richard Hart
|