transient 1.0.1 → 1.0.2
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.
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/lib/transient.rb +1 -1
- data/lib/transient/active_record_extensions.rb +5 -5
- data/transient.gemspec +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/transient.rb
CHANGED
@@ -33,7 +33,7 @@ module Transient
|
|
33
33
|
protected
|
34
34
|
|
35
35
|
def check_and_set_effective_at
|
36
|
-
self
|
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
|
58
|
-
return self
|
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
|
71
|
-
self
|
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.
|
data/transient.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{transient}
|
8
|
-
s.version = "1.0.
|
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{
|
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.
|
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:
|
12
|
+
date: 2010-03-18 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|