transient 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ = 1.0.2 2010--3-18
2
+
3
+ * Fixed bug where the effective_at date when implicitly set was not UTC.
4
+
5
+
1
6
  = 1.0.1 2009-12-29
2
7
 
3
8
  * Added call back to populate effective_at with DateTime.now if it is not explicitly set to something else.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -4,7 +4,7 @@ require 'date_time_extensions'
4
4
  require 'transient/active_record_extensions'
5
5
 
6
6
  module Transient
7
- VERSION = '1.0.1'
7
+ VERSION = '1.0.2'
8
8
  end
9
9
 
10
10
  ActiveRecord::Base.send( :include, Transient::ActiveRecordExtensions ) if defined?( ActiveRecord::Base )
@@ -33,7 +33,7 @@ module Transient
33
33
  protected
34
34
 
35
35
  def check_and_set_effective_at
36
- self[:effective_at] = DateTime.now if self[:effective_at].nil?
36
+ self.effective_at = Time.zone.now if self.effective_at.nil?
37
37
  end
38
38
 
39
39
  public
@@ -54,8 +54,8 @@ module Transient
54
54
  # The date this record expires. Returns DateTime.end_of for records that have a
55
55
  # nil value in the database.
56
56
  #
57
- def expiring_at
58
- return self[:expiring_at].nil? ? DateTime.end_of : self[:expiring_at]
57
+ def expires_at
58
+ return self.expiring_at.nil? ? DateTime.end_of : self.expiring_at
59
59
  end
60
60
 
61
61
  # The range this record is effective wihtin.
@@ -67,8 +67,8 @@ module Transient
67
67
  # Sets the range this record is effective within.
68
68
  #
69
69
  def effective_through=( value )
70
- self[:effective_at] = value.begin.to_datetime
71
- self[:expiring_at] = value.end.to_datetime
70
+ self.effective_at = value.begin.to_datetime
71
+ self.expiring_at = value.end.to_datetime
72
72
  end
73
73
 
74
74
  # Returns true if this record's exiring_at date is equivalent to DateTime.end_of, otherwise false.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{transient}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["C. Jason Harrelson (midas)"]
12
- s.date = %q{2009-12-29}
12
+ s.date = %q{2010-03-18}
13
13
  s.description = %q{Provides an API for making any ActiveRecord object transient. In addition, provides functionality for models where only a single instance of the model can be current at one time.}
14
14
  s.email = %q{jason@lookforwardenterprises.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transient
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-29 00:00:00 -06:00
12
+ date: 2010-03-18 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency