memories 0.2.12 → 0.2.13

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 +10 -2
  2. metadata +4 -4
data/lib/memories/base.rb CHANGED
@@ -3,7 +3,15 @@ module Memories
3
3
  def self.included(base)
4
4
  base.property(:milestone_memories) do |milestone_memory|
5
5
  milestone_memory.property :version
6
- milestone_memory.property :annotations, Memories::Annotation
6
+ milestone_memory.property :annotations,
7
+ Memories::Annotation,
8
+ :init_method => proc { |value|
9
+ a = Memories::Annotation.new
10
+ value.keys.each do |key|
11
+ a.send key, value[key]
12
+ end
13
+ a
14
+ }
7
15
  end
8
16
 
9
17
  base.before_update :add_version_attachment
@@ -237,7 +245,7 @@ module Memories
237
245
  def milestone!(&block)
238
246
  annotations = Memories::Annotation.new
239
247
  annotations.instance_eval(&block) if block
240
- self.milestone_memories << {:version => self.rev, :annotations => annotations}
248
+ self.milestone_memories << {:version => self.rev, :annotations => annotations.to_hash}
241
249
  self.save
242
250
  end
243
251
 
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 12
10
- version: 0.2.12
9
+ - 13
10
+ version: 0.2.13
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: 2010-12-28 00:00:00 -05:00
19
+ date: 2011-01-12 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency