collector 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -33,7 +33,7 @@ Collector.connection = Mongo::Connection.new
33
33
 
34
34
  ### Models
35
35
 
36
- Include `Collector::Model` in your domain objects to turn them into models. Create accessors for any attributes.
36
+ Include `Collector::Model` in your domain objects to turn them into models. Create accessors for any attributes. Accessors for `id`, `created_at`, and `updated_at` are created automatically.
37
37
 
38
38
  ```ruby
39
39
  class Pickle
@@ -31,7 +31,7 @@ module Collector
31
31
  def save_without_updating_timestamps(model)
32
32
  attributes = serialize!(model)
33
33
  id = collection.save(attributes)
34
- model.instance_variable_set("@id", id)
34
+ model.instance_variable_set("@id", id.to_s)
35
35
  model
36
36
  end
37
37
 
@@ -1,3 +1,3 @@
1
1
  module Collector
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -57,7 +57,8 @@ describe Collector::Repository do
57
57
  model = TestModel.new
58
58
  TestRepository.expects(:serialize!).with(model).returns({ foo: "bar" })
59
59
 
60
- collection = mock { expects(:save).with({ foo: "bar" }).returns("123abc") }
60
+ object_id = stub(to_s: "123abc")
61
+ collection = mock { expects(:save).with({ foo: "bar" }).returns(object_id) }
61
62
  TestRepository.stubs(:collection).returns(collection)
62
63
 
63
64
  updated_model = TestRepository.save_without_updating_timestamps(model)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport