concerned_states 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.4"
6
+ s.version = "0.1.5"
7
7
  s.authors = ["Richard Hart"]
8
8
  s.email = ["richard@ur-ban.com"]
9
9
  s.homepage = ""
@@ -6,6 +6,7 @@ module ConcernedStates
6
6
  PENDING = "pending"
7
7
  DECLINED = "declined"
8
8
  APPROVED = "approved"
9
+ INACTIVE = "inactive"
9
10
  ACTIVE = "active"
10
11
  FLAGGED = "flagged"
11
12
  SUSPENDED = "suspended"
@@ -30,6 +31,9 @@ module ConcernedStates
30
31
  scope :approved,
31
32
  where(:state => APPROVED)
32
33
 
34
+ scope :inactive,
35
+ where(:state => INACTIVE)
36
+
33
37
  scope :active,
34
38
  where(:state => ACTIVE)
35
39
 
@@ -77,6 +81,10 @@ module ConcernedStates
77
81
  def approve!; update_attribute(:state, APPROVE); end
78
82
  def approved?; self.state == APPROVED; end
79
83
 
84
+ def inactivate; self.state = INACTIVE; end
85
+ def inactivate!; update_attribute(:state, INACTIVE); end
86
+ def inactive?; self.state == INACTIVE; end
87
+
80
88
  def activate; self.state = ACTIVE; end
81
89
  def activate!; update_attribute(:state, ACTIVE); end
82
90
  def active?; self.state == ACTIVE; 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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Hart