has_schedule 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
data/has_schedule.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{has_schedule}
8
- s.version = "1.2.0"
8
+ s.version = "1.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Schlesinger"]
12
- s.date = %q{2011-03-14}
12
+ s.date = %q{2011-03-16}
13
13
  s.description = %q{Exposes an ice_cube schedule object and serializes it.}
14
14
  s.email = %q{ryan@instanceinc.com}
15
15
  s.extra_rdoc_files = [
data/lib/has_schedule.rb CHANGED
@@ -15,18 +15,24 @@ module HasSchedule
15
15
  module InstanceMethods
16
16
  def reload_with_schedule
17
17
  @schedule = nil
18
+ @nil_requested = nil
18
19
  reload_without_schedule
19
20
  end
20
21
 
21
22
  def save_with_schedule
22
- self.schedule_yaml = @schedule.andand.to_yaml
23
+ if (@schedule.nil? and @nil_requested != nil) or @schedule != nil
24
+ self.schedule_yaml = @schedule.andand.to_yaml
25
+ end
23
26
  end
24
27
 
25
28
  def schedule=(schedule)
26
29
  @schedule = schedule
27
30
 
28
31
  if @schedule.nil?
32
+ @nil_requested = true
29
33
  save_with_schedule
34
+ else
35
+ @nil_requested = nil
30
36
  end
31
37
  end
32
38
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_schedule
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Schlesinger
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-14 00:00:00 -07:00
18
+ date: 2011-03-16 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency