jeremyw-paper_trail 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.2.5
@@ -48,6 +48,17 @@ module PaperTrail
48
48
  :object => object_to_string(previous_version),
49
49
  :whodunnit => PaperTrail.whodunnit) if self.class.paper_trail_active
50
50
  end
51
+
52
+ # Returns the object at the version that was valid at the given timestamp.
53
+ def version_at timestamp
54
+ # short-circuit if the current state is valid
55
+ return self if self.updated_at < timestamp
56
+
57
+ version = versions.first(
58
+ :conditions => ['created_at < ?', timestamp],
59
+ :order => 'created_at DESC')
60
+ version.reify if version
61
+ end
51
62
 
52
63
  # Walk the versions to construct an audit trail of the edits made
53
64
  # over time, and by whom.
data/paper_trail.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{paper_trail}
5
- s.version = "1.2.3"
5
+ s.version = "1.2.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Andy Stewart", "Jeremy Weiskotten", "Joe Lind"]
9
- s.date = %q{2009-07-31}
10
- s.email = %q{boss@airbladesoftware.com}
9
+ s.date = %q{2009-08-07}
10
+ s.email = %q{jeremy@weiskotten.com}
11
11
  s.extra_rdoc_files = [
12
12
  "README.md"
13
13
  ]
@@ -38,10 +38,10 @@ Gem::Specification.new do |s|
38
38
  "uninstall.rb"
39
39
  ]
40
40
  s.has_rdoc = true
41
- s.homepage = %q{http://github.com/airblade/paper_trail}
41
+ s.homepage = %q{http://github.com/jeremyw/paper_trail}
42
42
  s.rdoc_options = ["--charset=UTF-8"]
43
43
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.1}
44
+ s.rubygems_version = %q{1.3.5}
45
45
  s.summary = %q{Track changes to your models' data. Good for auditing or versioning.}
46
46
  s.test_files = [
47
47
  "test/paper_trail_controller_test.rb",
@@ -52,13 +52,13 @@ Gem::Specification.new do |s|
52
52
  "test/test_helper.rb"
53
53
  ]
54
54
 
55
- if s.respond_to? :specification_version then
56
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
- s.specification_version = 2
58
-
59
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
60
- else
61
- end
62
- else
63
- end
55
+ # if s.respond_to? :specification_version then
56
+ # current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
+ # s.specification_version = 2
58
+ #
59
+ # if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
60
+ # else
61
+ # end
62
+ # else
63
+ # end
64
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeremyw-paper_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -11,12 +11,12 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-07-31 00:00:00 -07:00
14
+ date: 2009-08-07 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
18
18
  description:
19
- email: boss@airbladesoftware.com
19
+ email: jeremy@weiskotten.com
20
20
  executables: []
21
21
 
22
22
  extensions: []
@@ -49,7 +49,7 @@ files:
49
49
  - test/test_helper.rb
50
50
  - uninstall.rb
51
51
  has_rdoc: true
52
- homepage: http://github.com/airblade/paper_trail
52
+ homepage: http://github.com/jeremyw/paper_trail
53
53
  licenses:
54
54
  post_install_message:
55
55
  rdoc_options: