mongo_helper 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module MongoHelper
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/mongo_helper.rb CHANGED
@@ -32,6 +32,14 @@ module MongoHelper
32
32
  a.id = BSON::ObjectId.new
33
33
  a
34
34
  end
35
+
36
+ def mongo_new
37
+ a = self.new
38
+ a.id = BSON::ObjectId.new
39
+ a.created_at = Time.new if a.respond_to? :created_at
40
+ a.updated_at = Time.new if a.respond_to? :updated_at
41
+ return a
42
+ end
35
43
  end
36
44
 
37
45
  module InstanceMethods
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_helper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alan Graham
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-06-08 00:00:00 Z
18
+ date: 2012-06-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport