memories 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/memories/base.rb +9 -0
  2. metadata +4 -4
@@ -384,6 +384,7 @@ module Memories
384
384
  if properties = JSON.parse(self.read_attachment(version_id version))
385
385
  revert_attachments properties
386
386
  self.update_attributes_without_saving properties
387
+ overwrite_timestamp(properties)
387
388
  @logical_version_number = version
388
389
  @logical_revision = self.version_id version
389
390
  self.save if revert_type == :hard
@@ -455,4 +456,12 @@ module Memories
455
456
  self["_attachments"][attachment_id]["data"] = Base64.decode64 attachment_properties["data"] if attachment_properties["data"]
456
457
  end if self["_attachments"]
457
458
  end
459
+
460
+ def overwrite_timestamp(properties)
461
+ timestamp = 'updated_at'
462
+ if (properties.keys.include?(timestamp) && old_updated_at_time = Time.parse(properties[timestamp]) rescue nil)
463
+ write_attribute(timestamp, old_updated_at_time)
464
+ end
465
+ end
466
+
458
467
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memories
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Parker
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-17 00:00:00 -05:00
19
+ date: 2011-01-25 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency