mongoid 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid.rb +0 -8
- data/lib/mongoid/associations.rb +1 -1
- data/lib/mongoid/criterion/optional.rb +1 -1
- data/lib/mongoid/cursor.rb +0 -1
- data/lib/mongoid/document.rb +1 -1
- data/lib/mongoid/extensions.rb +2 -2
- data/lib/mongoid/extensions/objectid/conversions.rb +1 -1
- data/lib/mongoid/finders.rb +2 -2
- data/lib/mongoid/identity.rb +2 -2
- data/lib/mongoid/version.rb +1 -1
- metadata +24 -5
data/lib/mongoid.rb
CHANGED
@@ -19,14 +19,6 @@
|
|
19
19
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
20
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
require "rubygems"
|
23
|
-
|
24
|
-
gem "activesupport", ">= 2.2.2", "<3.0.pre"
|
25
|
-
gem "mongo", "~>1.0.1"
|
26
|
-
gem "bson", "~>1.0.1"
|
27
|
-
gem "durran-validatable", ">= 2.0.1"
|
28
|
-
gem "will_paginate", ">= 2.3.11", "< 2.9"
|
29
|
-
|
30
22
|
require "delegate"
|
31
23
|
require "singleton"
|
32
24
|
require "time"
|
data/lib/mongoid/associations.rb
CHANGED
@@ -69,7 +69,7 @@ module Mongoid # :nodoc:
|
|
69
69
|
def belongs_to_related(name, options = {}, &block)
|
70
70
|
opts = optionize(name, options, fk(name, options), &block)
|
71
71
|
associate(Associations::BelongsToRelated, opts)
|
72
|
-
field(opts.foreign_key, :type => Mongoid.use_object_ids ? BSON::
|
72
|
+
field(opts.foreign_key, :type => Mongoid.use_object_ids ? BSON::ObjectId : String)
|
73
73
|
index(opts.foreign_key) unless embedded?
|
74
74
|
end
|
75
75
|
|
data/lib/mongoid/cursor.rb
CHANGED
data/lib/mongoid/document.rb
CHANGED
@@ -149,7 +149,7 @@ module Mongoid #:nodoc:
|
|
149
149
|
# an empty +Hash+.
|
150
150
|
#
|
151
151
|
# If a primary key is defined, the document's id will be set to that key,
|
152
|
-
# otherwise it will be set to a fresh +BSON::
|
152
|
+
# otherwise it will be set to a fresh +BSON::ObjectId+ string.
|
153
153
|
#
|
154
154
|
# Options:
|
155
155
|
#
|
data/lib/mongoid/extensions.rb
CHANGED
data/lib/mongoid/finders.rb
CHANGED
@@ -42,7 +42,7 @@ module Mongoid #:nodoc:
|
|
42
42
|
# Find a +Document+ in several different ways.
|
43
43
|
#
|
44
44
|
# If a +String+ is provided, it will be assumed that it is a
|
45
|
-
# representation of a Mongo::
|
45
|
+
# representation of a Mongo::ObjectId and will attempt to find a single
|
46
46
|
# +Document+ based on that id. If a +Symbol+ and +Hash+ is provided then
|
47
47
|
# it will attempt to find either a single +Document+ or multiples based
|
48
48
|
# on the conditions provided and the first parameter.
|
@@ -51,7 +51,7 @@ module Mongoid #:nodoc:
|
|
51
51
|
#
|
52
52
|
# <tt>Person.find(:all, :conditions => { :attribute => "value" })</tt>
|
53
53
|
#
|
54
|
-
# <tt>Person.find(Mongo::
|
54
|
+
# <tt>Person.find(Mongo::ObjectId.new.to_s)</tt>
|
55
55
|
def find(*args)
|
56
56
|
raise Errors::InvalidOptions.new("Calling Document#find with nil is invalid") if args[0].nil?
|
57
57
|
type = args.delete_at(0) if args[0].is_a?(Symbol)
|
data/lib/mongoid/identity.rb
CHANGED
@@ -5,7 +5,7 @@ module Mongoid #:nodoc:
|
|
5
5
|
# Create the identity for the +Document+.
|
6
6
|
#
|
7
7
|
# The id will be set in either in the form of a Mongo
|
8
|
-
# +
|
8
|
+
# +ObjectId+ or a composite key set up by defining a key on the document.
|
9
9
|
#
|
10
10
|
# The _type will be set to the document's class name.
|
11
11
|
def create(doc)
|
@@ -15,7 +15,7 @@ module Mongoid #:nodoc:
|
|
15
15
|
protected
|
16
16
|
# Return the proper id for the document.
|
17
17
|
def generate_id
|
18
|
-
id = BSON::
|
18
|
+
id = BSON::ObjectId.new
|
19
19
|
Mongoid.use_object_ids ? id : id.to_s
|
20
20
|
end
|
21
21
|
|
data/lib/mongoid/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 55
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 9
|
8
|
-
-
|
9
|
-
version: 1.9.
|
9
|
+
- 2
|
10
|
+
version: 1.9.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Durran Jordan
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-09-17 00:00:00 -04:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: activesupport
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
|
-
- -
|
27
|
+
- - <
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
27
30
|
segments:
|
28
31
|
- 3
|
29
32
|
- 0
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: durran-validatable
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 13
|
41
46
|
segments:
|
42
47
|
- 2
|
43
48
|
- 0
|
@@ -49,9 +54,11 @@ dependencies:
|
|
49
54
|
name: will_paginate
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - <
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 17
|
55
62
|
segments:
|
56
63
|
- 2
|
57
64
|
- 9
|
@@ -62,9 +69,11 @@ dependencies:
|
|
62
69
|
name: mongo
|
63
70
|
prerelease: false
|
64
71
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
65
73
|
requirements:
|
66
74
|
- - ~>
|
67
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 21
|
68
77
|
segments:
|
69
78
|
- 1
|
70
79
|
- 0
|
@@ -76,9 +85,11 @@ dependencies:
|
|
76
85
|
name: bson
|
77
86
|
prerelease: false
|
78
87
|
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
79
89
|
requirements:
|
80
90
|
- - ~>
|
81
91
|
- !ruby/object:Gem::Version
|
92
|
+
hash: 21
|
82
93
|
segments:
|
83
94
|
- 1
|
84
95
|
- 0
|
@@ -90,9 +101,11 @@ dependencies:
|
|
90
101
|
name: rspec
|
91
102
|
prerelease: false
|
92
103
|
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
93
105
|
requirements:
|
94
106
|
- - "="
|
95
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 27
|
96
109
|
segments:
|
97
110
|
- 1
|
98
111
|
- 3
|
@@ -104,9 +117,11 @@ dependencies:
|
|
104
117
|
name: mocha
|
105
118
|
prerelease: false
|
106
119
|
requirement: &id007 !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
107
121
|
requirements:
|
108
122
|
- - "="
|
109
123
|
- !ruby/object:Gem::Version
|
124
|
+
hash: 43
|
110
125
|
segments:
|
111
126
|
- 0
|
112
127
|
- 9
|
@@ -237,16 +252,20 @@ rdoc_options: []
|
|
237
252
|
require_paths:
|
238
253
|
- lib
|
239
254
|
required_ruby_version: !ruby/object:Gem::Requirement
|
255
|
+
none: false
|
240
256
|
requirements:
|
241
257
|
- - ">="
|
242
258
|
- !ruby/object:Gem::Version
|
259
|
+
hash: 3
|
243
260
|
segments:
|
244
261
|
- 0
|
245
262
|
version: "0"
|
246
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
|
+
none: false
|
247
265
|
requirements:
|
248
266
|
- - ">="
|
249
267
|
- !ruby/object:Gem::Version
|
268
|
+
hash: 23
|
250
269
|
segments:
|
251
270
|
- 1
|
252
271
|
- 3
|
@@ -255,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
274
|
requirements: []
|
256
275
|
|
257
276
|
rubyforge_project: mongoid
|
258
|
-
rubygems_version: 1.3.
|
277
|
+
rubygems_version: 1.3.7
|
259
278
|
signing_key:
|
260
279
|
specification_version: 3
|
261
280
|
summary: Elegent Persistance in Ruby for MongoDB.
|