concerned_states 0.1.2 → 0.1.3

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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "concerned_states"
6
- s.version = "0.1.2"
6
+ s.version = "0.1.3"
7
7
  s.authors = ["Richard Hart"]
8
8
  s.email = ["richard@ur-ban.com"]
9
9
  s.homepage = ""
@@ -2,21 +2,21 @@ module ConcernedStates
2
2
  module Stateable
3
3
  extend ActiveSupport::Concern
4
4
 
5
- included do
6
- PASSIVE = "passive"
7
- PENDING = "pending"
8
- DECLINED = "declined"
9
- APPROVED = "approved"
10
- ACTIVE = "active"
11
- FLAGGED = "flagged"
12
- SUSPENDED = "suspended"
13
- DELETED = "deleted"
14
- STARTED = "started"
15
- PAUSED = "paused"
16
- CANCELLED = "cancelled"
17
- COMPLETED = "completed"
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Hart