acts_as_status_for 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_status_for}
8
- s.version = "2.0.0"
8
+ s.version = "2.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Curtis Schofield"]
12
- s.date = %q{2011-06-27}
12
+ s.date = %q{2011-06-28}
13
13
  s.description = %q{Given a list of datetime _at attributes }
14
14
  s.email = %q{github.com@robotarmyma.de}
15
15
  s.extra_rdoc_files = [
@@ -40,17 +40,13 @@ module ActsAsStatusFor
40
40
  end
41
41
 
42
42
  define_method "not_#{state}!" do
43
- if self.__send__("#{state}?")
44
- self.send("#{state}_at=".to_sym,nil)
45
- self.save!
46
- end
43
+ self.send("#{state}_at=".to_sym,nil)
44
+ self.save!
47
45
  end
48
46
 
49
47
  define_method "#{state}!" do
50
- unless self.__send__("#{state}?")
51
- self.send("#{state}_at=".to_sym,Time.now)
52
- self.save!
53
- end
48
+ self.send("#{state}_at=".to_sym,Time.now)
49
+ self.save!
54
50
  end
55
51
  else
56
52
  log_error(state)
@@ -51,6 +51,16 @@ describe ActsAsStatusFor do
51
51
  subject.current_status.should == 'on_hold'
52
52
  end
53
53
 
54
+ it 'can go back and forth between two events' do
55
+ subject.on_hold!
56
+ subject.current_status.should == 'on_hold'
57
+ subject.archived!
58
+ subject.current_status.should == 'archived'
59
+ subject.on_hold!
60
+ subject.current_status.should == 'on_hold'
61
+ subject.on_hold_at > subject.archived_at
62
+ end
63
+
54
64
  it 'can be wound and unwound' do
55
65
  subject.on_hold!
56
66
  subject.current_status.should == 'on_hold'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: acts_as_status_for
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.0
5
+ version: 2.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Curtis Schofield
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-27 00:00:00 -07:00
13
+ date: 2011-06-28 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- hash: 1247048969588569045
119
+ hash: -1995968481398183006
120
120
  segments:
121
121
  - 0
122
122
  version: "0"