ixtlan-optimistic 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,11 +30,14 @@ module Ixtlan
30
30
  end
31
31
 
32
32
  def __check_stale( updated_at, result )
33
- if updated_at.is_a?( String )
33
+ if updated_at.is_a? String
34
34
  updated_at = DateTime.parse( updated_at.sub(/[.][0-9]+/, '') )
35
35
  end
36
+ if defined?( ActiveSupport ) && updated_at.is_a?( ActiveSupport::TimeWithZone )
37
+ updated_at = updated_at.to_datetime
38
+ end
36
39
  updated_at = updated_at.new_offset(0)
37
- if updated_at != result.updated_at && updated_at.strftime("%Y:%m:%d %H:%M:%S") != result.updated_at.new_offset(0).strftime("%Y:%m:%d %H:%M:%S")
40
+ if updated_at != result.updated_at && updated_at.strftime("%Y:%m:%d %H:%M:%S") != result.updated_at.strftime("%Y:%m:%d %H:%M:%S")
38
41
 
39
42
  raise ObjectStaleException.new "#{result.inspect} is stale for updated at #{updated_at}."
40
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ixtlan-optimistic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - mkristian
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-29 00:00:00 Z
18
+ date: 2013-01-02 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest