Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 686 lines (393 sloc) 24.218 kb
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
1 # Overview
2
87a1d4a @durran Fix eager loading to load all relations passed to includes. Fixes #1295.
durran authored
3 For instructions on upgrading to newer versions, visit
4 [mongoid.org](http://mongoid.org/docs/upgrading.html).
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
5
e34f140 @durran Merge changelog
durran authored
6 ## 2.4.0 \[ In Development \] \[ Branch: master \]
b6a2a99 Add range queries to Criteria#where
Durran Jordan and Hans Hasselberg authored
7
055e6ef @durran Merge in 2.3.0-stable
durran authored
8 ### New Features
9
b6a2a99 Add range queries to Criteria#where
Durran Jordan and Hans Hasselberg authored
10 * Ranges can now be passed to #where criteria to create a $gte/$lte query under the
11 covers. `Person.where(dob: start_date...end_date)`
12
7d26541 @durran Move after_build callback to post yield.
durran authored
13 * \#1454, \#900 Associations now have an `after_build` callback that gets
14 executed after `.build` or `build_` methods are called.
15 (Jeffrey Jones, Ryan Townsend)
16
6524aeb @durran Update changelog
durran authored
17 * \#1451 Ranges can now be any range value, not just numbers. (aupajo)
18
19 * \#1448 Localization is now used when sorting. (Hans Hasselberg)
20
d62fdb7 @durran Merge in pull request #1422
durran authored
21 * \#1422 Mongoid raises an error at yaml load if no environment is found.
22 (Tom Stuart)
23
4087c0e @durran Update changelog for pull requests
durran authored
24 * \#1413 $not support added to criteria symbol methods. (Marc Weil)
25
b496b8d @durran Merging in #1403 and providing english translations in the other locales...
durran authored
26 * \#1403 Added configuration option `scope_overwrite_exception` which defaults to
27 false for raising an error when defining a named scope with the same name of
28 an existing method. (Christoph Grabo)
29
4cb8278 @durran Allow Model#add_to_set to accept multiple values. (Christian Felder). Cl...
durran authored
30 * \#1388 `model.add_to_set` now supports adding multiple values and performs an
31 $addToSet with $each under the covers. (Christian Felder)
32
c40a43f @durran Refactor common code in threaded module
durran authored
33 * \#1387 Added `Model#cache_key` for use in Rails caching. (Seivan Heidari)
94759ff @durran Merge in #1387, move functionality into document from timestamps.
durran authored
34
1011f8d @durran Convert params to Model.find(id) to whatever the _id field type is defin...
durran authored
35 * \#1380 Calling Model.find(id) will now properly convert to and from any type
36 based on the type of the _id field.
37
ae473a8 @durran Add default support to localized fields. Closes #1363.
durran authored
38 * \#1363 Added fallbacks and default support to localized fields, and added
39 ability to get and set all translations at once.
40
c40a43f @durran Refactor common code in threaded module
durran authored
41 ### Resolved Issues
40a46ef @durran Calling destroy on any document now temporarily marks it as
durran authored
42
c32da79 @durran Add fields to subclasses when getting added to the parent. Fixes #1483.
durran authored
43 * \#1483 Sending module includes at runtime which add new fields to a parent
44 document, also have the fields added to subclasses.
45
693f3c9 @durran Batch insert consumers should scope to the collection. Fixes #1463.
durran authored
46 * \#1463 Batch insert consumers are now scoped to collection to avoid persistence
47 of documents to other collections in callbacks going to the wrong place.
48
98d989a @durran Don't escape entire hash of foreign key criteria arguments. Fixes #1461.
durran authored
49 * \#1461 Fixed serialization of foreign key fields in complex criteria not to
50 escape the entire hash.
51
5e1aa45 @durran Don't skip fields protected from mass assignment when versioning. Fixes ...
durran authored
52 * \#1458 Versioning no longer skips fields that have been protected from mass
53 assignment.
54
40a46ef @durran Calling destroy on any document now temporarily marks it as
durran authored
55 * \#1455, \#1456 Calling destroy on any document now temporarily marks it as
56 flagged for destroy until the operation is complete. (Nader Akhnoukh)
055e6ef @durran Merge in 2.3.0-stable
durran authored
57
9381dc9 @durran Destroyed documents should return id in Model.to_key. Fixes #1453
durran authored
58 * \#1453 `Model#to_key` should return a value is the document is destroyed.
59
bd4df6f @durran Provide fix for specs in #1449.
durran authored
60 * \#1449 New documents no longer get persisted when replaced on a has one as
61 a side effect. (jasonsydes)
62
c52d330 @durran embedded? should return true when relation is defined as cyclic. Closes ...
durran authored
63 * \#1439 embedded? should return true when relation defined as cyclic.
64
9526660 @durran Update changelog
durran authored
65 * \#1426 Frozen documents can now be cloned. (aagrawal2001)
66
4087c0e @durran Update changelog for pull requests
durran authored
67 * \#1382 Raise proper error when creating indexes via rake task if index
68 definition is incorrect. (Mathieu Ravaux)
69
81159b8 @durran Merging in pull request #1381.
durran authored
70 * \#1381, \#1371 The identity map now functions properly with inherited
71 documents. (Paul Canavese)
72
a6e559e @durran Provide ability to avoid all named scopes to be applied with default sco...
durran authored
73 * \#1359 Provide ability to not have default scope applied to all named
74 scopes via using lambdas.
75
b9e7a33 @durran Fix specs, update changelog
durran authored
76 * \#1333 Fixed errors with custom types that exist in namespaces. (Peter Gumeson)
77
3017c2a @durran Update changelog
durran authored
78 ## 2.3.4
948801c @durran Update changelog
durran authored
79
4f62b9e @durran Remove duplicates from the loaded array on each as the second condition ...
durran authored
80 * \#1445 Prevent duplicate documents in the loaded array on the target
81 enumerable for relational associations.
82
73020aa @durran Allow destructive replacement on has_one relations when using create_ me...
durran authored
83 * \#1442 When using create_ methods for has one relations, the appropriate
84 destructive methods now get called when replacing an existing document.
85
e3f9e8d @durran Change enumerable context to add to loaded array post yield, instead of ...
durran authored
86 * \#1431 Enumerable context should add to the loaded array post yield, so
87 that methods like #any? that short circuit based on the value of the block
88 dont falsely have extra documents.
89
947bdbc @durran Don't load previous revisions of documents into the identity map. Fixes ...
durran authored
90 * \#1418 Documents being loaded from the database for revision purposes
91 no longer get placed in the identity map.
92
fe1472c @durran Allow casting of foreign keys where appropriate in serialization to non ...
durran authored
93 * \#1399 Allow conversion of strings to integers in foreign keys where the
94 id is defined as an int.
95
ddcd16e @durran Don't add default sorting criteria on first if they sort criteria alread...
durran authored
96 * \#1397 Don't add default sorting criteria on first if they sort criteria
97 already exists.
98
fc2dbf4 @durran Update changelog to reflect nicks fix
durran authored
99 * \#1394 Fix exists? to work when count is greater than 1. (Nick Hoffman)
100
33b1fff @durran Return zero on aggregations when field does not exist. Fixes #1392
durran authored
101 * \#1392 Return 0 on aggregation functions where field is nonexistant.
102
28ab6d8 @durran Fix uniqueness validation with embedded documents using primary keys and...
durran authored
103 * \#1391 Uniqueness validation now works properly on embedded documents that are
104 using primary key definitions.
105
33507e5 @durran When _type field is altered attempt to correctly instantiate the class. ...
durran authored
106 * \#1390 When _type field is lower case class camelize before constantizing.
107
4b93f99 @durran Fix cast on read for serializable fields that are subclassed. Fixes #138...
durran authored
108 * \#1383 Fix cast on read for serializable fields that are subclassed.
109
04c3870 @durran Fix delayed atomic sets and push interactions for documents embedded mul...
durran authored
110 * \#1357 Delayed atomic sets from update_attributes on embedded documents
111 multiple levels deep now properly persist.
112
19a4583 @durran Synchronize base keys on save of newly built inverse documents on HABTM....
durran authored
113 * \#1326 Ensure base document on HABTM gets its keys saved after saving a newly
114 build child document.
115
0e43b30 @durran Don't override base document metadata on embedded in relations if alread...
durran authored
116 * \#1301 Don't overwrite base metadata on embedded in relations if already set.
117
4e0759e @durran Update changelog
durran authored
118 * \#1221 HABTM with inverse nil is allowed again on embedded documents.
119
8c4375e @durran Don't auto-persist embedded in relations on initialization. Fixes #1208.
durran authored
120 * \#1208 Don't auto-persist child documents via the setter when setting from
121 an embedded_in.
122
2089085 @durran Root document timestamps get updated when only embedded documents have c...
durran authored
123 * \#791 Root document updates its timestamps when only embedded documents have
124 changed.
125
948801c @durran Update changelog
durran authored
126 ## 2.3.3
ae96e29 @durran Fix type errors on many-to-many relations with a nil inverse. Fixes #135...
durran authored
127
128 ### Resolved Issues
129
6b412f0 @durran Update changelog
durran authored
130 * \#1386 Lowered mongo/bson dependency to 1.3
131
bead126 @durran Fix aggregate functions to handle non existant fields. Fixes #1377. (Max...
durran authored
132 * \#1377 Fix aggregation functions to properly handle nil or indefined values.
133 (Maxime Garcia)
134
cc9d285 @durran Update changelog
durran authored
135 * \#1373 Warn if a scope overrides another scope.
136
184376b @durran Don't persist in a create block when reading for validation. Fixes #1372...
durran authored
137 * \#1372 Never persist when binding inside of a read attribute for validation.
138
01122fe @durran Fix reloading of documents with non-object ids as their ids. Fixes #1364...
durran authored
139 * \#1364 Fixed reloading of documents with non bson object id ids.
140
77f3ecf @durran Fix performanace of dev load times with observers in rails. Fixes #1360.
durran authored
141 * \#1360 Fixed performance of Mongoid's observer instantiation by hooking into
142 Active Support's load hooks, a la AR.
143
ae96e29 @durran Fix type errors on many-to-many relations with a nil inverse. Fixes #135...
durran authored
144 * \#1358 Fixed type error on many to many synchronization when inverse_of is
145 set to nil.
146
3cdd5f5 @durran Update changelog
durran authored
147 * \#1356 $in criteria can now be chained to non-complex criteria on the same
148 key without error.
149
7d152bc @durran Update changelog
durran authored
150 * \#1350, \#1351 Fixed errors in the string conversions of double quotes and
151 tilde when paramterizing keys.
152
999e9d0 @durran Documents should not blow up when including enumerable. Fixes #1349
durran authored
153 * \#1349 Mongoid documents should not blow up when including Enumerable.
154 (Jonas Nicklas)
155
ae96e29 @durran Fix type errors on many-to-many relations with a nil inverse. Fixes #135...
durran authored
156 ## 2.3.2
16d6f2f @durran Document#reload on an embedded document now works properly. Fixes #736.
durran authored
157
9b06181 @durran Merging in 2.3.0-stable
durran authored
158 ### Resolved Issues
159
eb90725 @durran Return default matcher for hash values that dont have modifier keys. Fix...
durran authored
160 * \#1347 Fix embedded matchers when provided a hash value that does not have a
161 modifier as a key.
162
13e7e55 @durran Update changelog
durran authored
163 * \#1346 Dup default sorting criteria when calling first/last on a criteria.
164
16d6f2f @durran Document#reload on an embedded document now works properly. Fixes #736.
durran authored
165 * \#1343 When passing no arguments to `Criteria#all_of` return all documents.
166 (Chris Leishman)
167
518ea6b Update that changelog, like a boss.
Dave Krupinski and Durran Jordan authored
168 * \#1339 Ensure destroy callbacks are run on cascadable children when deleting via
169 nested attributes.
170
a47a904 @durran Respect inverse_of: nil on self referencing many-to-many relations. Fixe...
durran authored
171 * \#1324 Setting `inverse_of: nil` on a many-to-many referencing the same class
172 returns nil for the inverse foreign key.
173
23d758e @durran Updating changelog
durran authored
174 * \#1323 Allow both strings and symbols as ids in the attributes array for
175 nested attributes. (Michael Wood)
176
0465832 @durran Update changelog
durran authored
177 * \#1312 Setting a logger on the config now accepts anything that quacks like a
178 logger.
179
14e5bdc @durran Update changelog
durran authored
180 * \#1297 Don't hit the database when accessing relations if the base is new.
181
1ec8bbc @durran Update changelog
durran authored
182 * \#1239 Allow appending of referenced relations in create blocks, post default set.
183
23d758e @durran Updating changelog
durran authored
184 * \#1236 Ensure all models are loaded in rake tasks, so even in threadsafe mode
185 all indexes can be created.
186
16d6f2f @durran Document#reload on an embedded document now works properly. Fixes #736.
durran authored
187 * \#736 Calling #reload on embedded documents now works properly.
188
ab74efb Update master changelog
Dave Krupinski and Durran Jordan authored
189 ## 2.3.1
e34f140 @durran Merge changelog
durran authored
190
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
191 ### Resolved Issues
192
fd6a135 Updating changelog
Dave Krupinski and Durran Jordan authored
193 * \#1338 Calling #find on a scope or relation checks that the document in the
194 identity map actually matches other scope parameters.
195
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
196 * \#1321 HABTM no longer allows duplicate entries or keys, instead of the previous
197 inconsistencies.
198
199 * \#1320 Fixed errors in perf benchmark.
200
201 * \#1316 Added a separate Rake task "db:mongoid:drop" so Mongoid and AR can coexist.
202 (Daniel Vartanov)
203
204 * \#1311 Fix issue with custom field serialization inheriting from hash.
205
fd6a135 Updating changelog
Dave Krupinski and Durran Jordan authored
206 * \#1310 The referenced many enumerable target no longer duplicates loaded and
207 added documents when the identity map is enabled.
208
87a1d4a @durran Fix eager loading to load all relations passed to includes. Fixes #1295.
durran authored
209 * \#1295 Fixed having multiple includes only execute the eager loading of the first.
210
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
211 * \#1287 Fixed max versions limitation with versioning.
212
213 * \#1277 attribute_will_change! properly flags the attribute even if no change occured.
214
fd6a135 Updating changelog
Dave Krupinski and Durran Jordan authored
215 * \#1063 Paranoid documents properly run destroy callbacks on soft destroy.
216
bf01898 @durran Update changelog
durran authored
217 * \#1061 Raise `Mongoid::Errors::InvalidTime` when time serialization fails.
218
311bbe4 @durran Update changelog to include 1002
durran authored
219 * \#1002 Check for legal bson ids when attempting conversion.
220
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
221 * \#920 Allow relations to be named target.
222
399f46f @durran Return normalized class name for relation definitions that prepend ::. F...
durran authored
223 * \#905 Return normalized class name in metadata if string was defined with a
224 prefixed ::.
225
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
226 * \#861 accepts_nested_attributes_for is no longer needed to set embedded documents
227 via a hash or array of hashes directly.
228
731032f @durran Sync CHANGELOG
durran authored
229 * \#857 Fixed cascading of dependent relations when base document is paranoid.
230
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
231 * \#768 Fixed class_attribute definitions module wide.
232
233 * \#408 Embedded documents can now be soft deleted via `Mongoid::Paranoia`.
709acc4 @durran updating CHANGELOG
durran authored
234
be78d8c @durran Updating changelog
durran authored
235 ## 2.3.0
813392f @durran Updating changelog to current master
durran authored
236
237 ### New Features
238
239 * Mongoid now supports basic localized fields, storing them under the covers as a
49aef9e @durran Sync CHNAGELOG across active branches
durran authored
240 hash of locale => value pairs. `field :name, localize: true`
813392f @durran Updating changelog to current master
durran authored
241
4e1f8a9 @durran Updating changelog for unsafely addition.
durran authored
242 * \#1275 For applications that default safe mode to true, you can now tell a
243 single operation to persist without safe mode via #unsafely:
244 `person.unsafely.save`, `Person.unsafely.create`. (Matt Sanders)
245
32abed3 @durran Update changelog to include latest fixes
durran authored
246 * \#1256 Mongoid now can create indexes for models in Rails engines. (Caio Filipini)
247
8046299 @durran Updating changelog
durran authored
248 * \#1228 Allow pre formatting of compsoite keys by passing a block to #key.
249 (Ben Hundley)
250
3d05a17 @durran Updating changelog to reflect scoped mass assignment
durran authored
251 * \#1222 Scoped mass assignment is now supported. (Andrew Shaydurov)
252
32abed3 @durran Update changelog to include latest fixes
durran authored
253 * \#1196 Timestamps can now be turned off on a call-by-call basis via the use
254 of #timeless: `person.timeless.save`, `Person.timeless.create(:title => "Sir")`.
255
86384ae @durran Updating changelog
durran authored
256 * \#1103 Allow developers to create their own custom complex criteria. (Ryan Ong)
257
81f81e1 @cgriego Include all defined fields in `serializable_hash`.
cgriego authored
258 * Mongoid now includes all defined fields in `serializable_hash` and `to_json`
259 results even if the fields have no values to make serialized documents easier
260 to use by ActiveResource clients.
261
49e3c4e @durran Updating changelog to reflect MongoDB version requirement
durran authored
262 * Support for MongoDB's $and operator is now available in the form of:
263 `Criteria#all_of(*args)` where args is multiple hash expressions.
264
be78d8c @durran Updating changelog
durran authored
265 * \#1250, \#1058 Embedded documents now can have their callbacks fired on a parent
266 save by setting `:cascade_callbacks => true` on the relation.
267 (pyromanic, Paul Rosania, Jak Charlton)
268
813392f @durran Updating changelog to current master
durran authored
269 ### Major Changes
270
271 * Mongoid now depends on Active Model 3.1 and higher.
272
273 * Mongoid now depends on the Mongo Ruby Driver 1.4 and higher.
274
49e3c4e @durran Updating changelog to reflect MongoDB version requirement
durran authored
275 * Mongoid requires MongoDB 2.0.0 and higher.
276
813392f @durran Updating changelog to current master
durran authored
277 ### Resolved Issues
278
32abed3 @durran Update changelog to include latest fixes
durran authored
279 * \#1308 Fixed scoping of HABTM finds.
280
281 * \#1300 Namespaced models should handle recursive embedding properly.
282
3745763 @durran Don't fail on binding with self-referenced versioned documents. Fixes #1...
durran authored
283 * \#1299 Self referenced documents with versioning no longer fail when inverse_of
284 is not defined on all relations.
285
32abed3 @durran Update changelog to include latest fixes
durran authored
286 * \#1296 Renamed internal building method to _building.
287
1d0d267 @durran Exclude _id and updated_at from versioned attributes.
durran authored
288 * \#1288, \#1289 _id and updated_at should not be part of versioned attributes.
289
813392f @durran Updating changelog to current master
durran authored
290 * \#1273 Mongoid.preload_models now checks if preload configuration option is set,
291 where Mongoid.load_models always loads everything. (Ryan McGeary)
292
32abed3 @durran Update changelog to include latest fixes
durran authored
293 * \#1244 Has one relations now adhere to default dependant behaviour.
294
295 * \#1225 Fixed delayed persistence of embedded documents via $set.
296
bd96164 @durran Update changelog
durran authored
297 * \#1166 Don't load config in Railtie if no env variables defined. (Terence Lee)
298
813392f @durran Updating changelog to current master
durran authored
299 * \#1052 `alias_attribute` now works again as expected.
300
8046299 @durran Updating changelog
durran authored
301 * \#939 Apply default attributes when upcasting via #becomes. (Christos Pappas)
302
b0760d2 @durran Fix casting of integer fields with leading zeros. Fixes #932.
durran authored
303 * \#932 Fixed casting of integer fields with leading zeros.
304
86384ae @durran Updating changelog
durran authored
305 * \#948 Reset version number on clone if versions existed.
306
307 * \#763 Don't merge $in criteria arrays when chaining named scopes.
308
309 * \#730 Existing models that have relations added post persistence of originals
310 can now have new relations added with no migrations.
311
8388554 @durran Update changelog for recent fixes
durran authored
312 * \#726 Embedded documents with compound keys not validate uniqueness correctly.
313
314 * \#582 Cyclic non embedded relations now validate uniqueness correctly.
315
316 * \#484 Validates uniqueness with multiple scopes of all types now work properly.
317
c63ac24 @durran Ensure cascade callbacks do not fire when deleting versions
durran authored
318 * Deleting versions created with `Mongoid::Versioning` no longer fires off
319 dependent cascading on relations.
320
aea719c @durran Update master changelog
durran authored
321 ## 2.2.4
322
323 * \#1377 Fix aggregation functions to properly handle nil or indefined values.
324 (Maxime Garcia)
325
326 * \#1373 Warn if a scope overrides another scope.
327
328 * \#1372 Never persist when binding inside of a read attribute for validation.
329
330 * \#1358 Fixed type error on many to many synchronization when inverse_of is
331 set to nil.
332
333 * \#1356 $in criteria can now be chained to non-complex criteria on the same
334 key without error.
335
336 * \#1350, \#1351 Fixed errors in the string conversions of double quotes and
337 tilde when paramterizing keys.
338
339 * \#1349 Mongoid documents should not blow up when including Enumerable.
340 (Jonas Nicklas)
341
ab74efb Update master changelog
Dave Krupinski and Durran Jordan authored
342 ## 2.2.3
343
344 * \#1295 Fixed having multiple includes only execute the eager loading of the first.
345
346 * \#1225 Fixed delayed persistence of embedded documents via $set.
347
348 * \#1002 Fix BSON object id conversion to check if legal first.
e34f140 @durran Merge changelog
durran authored
349
0386f21 @durran Updating changelog for 2.2.2 notes
durran authored
350 ## 2.2.2
351
352 * This release removes the restriction of a dependency on 1.3.x of the mongo
353 ruby driver. Users may now use 1.3.x through 1.4.x.
354
f325f06 @durran Updating changelog with dot notation fixes. Closes #1210. Closes #517.
durran authored
355 ## 2.2.1
356
2a5fb23 @durran Updating changelog for 2.2.1
durran authored
357 ### Resolved Issues
358
f325f06 @durran Updating changelog with dot notation fixes. Closes #1210. Closes #517.
durran authored
359 * \#1210, \#517 Allow embedded document relation queries to use dot notation.
360 (Scott Ellard)
361
d16adf8 @durran Updating changelog
durran authored
362 * \#1198 Enumerable target should use criteria count if loaded has no docs.
363
2a5fb23 @durran Updating changelog for 2.2.1
durran authored
364 * \#1164 Get rid of remaining no method in_memory errors.
c0a6e6c @durran Ensure all integer fields convert n precision 0 floats to an int. Fixes ...
durran authored
365
2a5fb23 @durran Updating changelog for 2.2.1
durran authored
366 * \#1070 Allow custom field serializers to have their own constructors.
367
368 * \#1176 Allow access to parent documents from embedded docs in after_destroy
369 callbacks.
370
371 * \#1191 Context group methods (min, max, sum) no longer return NaN but instead
372 return nil if field doesn't exist or have values.
373
374 * \#1193, \#1271 Always return Integers for integer fields with .000 precisions,
375 not floats.
376
377 * \#1199 Fixed performance issues of hash and array field access when reading
378 multiple times.
379
380 * \#1218 Fixed issues with relations referencing models with integer foreign keys.
381
382 * \#1219 Fixed various conflicting modifications issues when pushing and pulling
383 from the same embedded document in a single call.
384
385 * \#1220 Metadata should not get overwritten by nil on binding.
386
387 * \#1231 Renamed Mongoid's atomic set class to Sets to avoid conflicts with Ruby's
388 native Set after document inclusion.
389
390 * \#1232 Fix access to related models during before_destroy callbacks when
391 cascading.
392
393 * \#1234 Fixed HABTM foreign key synchronization issues when destroying
394 documents.
395
396 * \#1243 Polymorphic relations dont convert to object ids when querying if the
397 ids are defined as strings.
398
399 * \#1247 Force Model.first to sort by ascending id to guarantee first document.
400
401 * \#1248 Added #unscoped to embedded many relations.
402
403 * \#1249 Destroy flags in nested attributes now actually destroy the document
404 for has_many instead of just breaking the relation.
405
406 * \#1272 Don't modify configuration options in place when creating replica set
407 connections.
f325f06 @durran Updating changelog with dot notation fixes. Closes #1210. Closes #517.
durran authored
408
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
409 ## 2.2.0
410
411 ### New Features
412
75f2651 @durran Updating changelog error in includes syntax.
durran authored
413 * Mongoid now contains eager loading in the form of `Criteria#includes(*args)`.
140f31f @durran Updating changelog includes example.
durran authored
414 This works on has_one, has_many, belongs_to associations and requires the identity map to
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
415 be enabled in order to function. Set `identity_map_enabled: true` in your
140f31f @durran Updating changelog includes example.
durran authored
416 `mongoid.yml`. Ex: `Person.where(title: "Sir").includes(:posts, :game)`
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
417
418 * Relations can now take a module as a value to the `:extend` option. (Roman
419 Shterenzon)
420
421 * Capped collections can be created by passing the options to the `#store_in`
422 macro: `Person.store_in :people, capped: true, max: 1000000`
423
a4e2b38 @durran Updating changelog before I start forgetting things.
durran authored
424 * Mongoid::Collection now supports `collection.find_and_modify`
425
426 * `Document#has_attribute?` now aliases to `Document#attribute_present?`
427
428 * \#930 You can now turn off the Mongoid logger via the mongoid.yml by
429 doing `logger: false`
430
431 * \#909 We now raise a `Mongoid::Errors::Callback` exception if persisting with
432 a bang method and a callback returns false, instead of the uninformative
433 validations error from before.
434
435 ### Major Changes
436
437 * \#1173 has_many relations no longer delete all documents on a set of the relation
438 (= [ doc_one, doc_two ]) but look to the dependent option to determine what
439 behaviour should occur. :delete and :destroy will behave as before, :nullify and
440 no option specified will both nullify the old documents without deleting.
441
442 * \#1142, \#767 Embedded relations no longer immediately persist atomically
443 when accessed via a parent attributes set. This includes nested attributes setting
444 and `attributes=` or `write_attributes`. The child changes then remain dirty and
445 atomically update when save is called on them or the parent document.
446
447 ### Resolved Issues
448
449 * \#1190 Fixed the gemspec errors due to changing README and CHANGELOG to markdown.
450
451 * \#1180, \#1084, \#955 Mongoid now checks the field types rather than if the name
452 contains `/id/` when trying to convert to object ids on criteria.
453
454 * \#1176 Enumerable targets should always return the in memory documents first,
455 when calling `#first`
456
457 * \#1175 Make sure both sides of many to many relations are in sync during a create.
458
459 * \#1172 Referenced enumerable relations now properly handle `#to_json`
460 (Daniel Doubrovkine)
461
462 * \#1040 Increased performance of class load times by removing all delegate calls
463 to self.class.
464
a11cc27 @gmile Changelog: rdoc -> md
gmile authored
465 ## 2.1.9
466
467 ### Resolved Issues
468
469 * \#1159 Fixed build blocks not to cancel out each other when nested.
470
471 * \#1154 Don't delete many-to-many documents on empty array set.
472
473 * \#1153 Retain parent document reference in after callbacks.
474
475 * \#1151 Fix associated validation infinite loop on self referencing documents.
476
477 * \#1150 Validates associated on `belongs_to` is `false` by default.
478
479 * \#1149 Fixed metadata setting on `belongs_to` relations.
480
481 * \#1145 Metadata inverse should return `nil` if `inverse_of` was set as `nil`.
482
483 * \#1139 Enumerable targets now quack like arrays.
484
485 * \#1136 Setting `belongs_to` parent to `nil` no longer deletes the parent.
486
487 * \#1120 Don't call `in_memory` on relations if they don't respond to it.
488
489 * \#1075 Set `self` in default procs to the document instance.
490
491 * \#1072 Writing attributes for nested documents can take a hash or array of hashes.
492
493 * \#990 Embedded documents can use a single `embedded_in` with multiple parent definitions.
494
495 ## 2.1.8
496
497 ### Resolved Issues
498
499 * \#1148 Fixed `respond_to?` on all relations to return properly.
500
501 * \#1146 Added back the Mongoid destructive fields check when defining fields.
502
503 * \#1141 Fixed conversions of `nil` values in criteria.
504
505 * \#1131 Verified Mongoid/Kaminari paginating correctly.
506
507 * \#1105 Fixed atomic update consumer to be scoped to class.
508
509 * \#1075 `self` in default lambdas and procs now references the document instance.
510
511 * \#740 Removed `embedded_object_id` configuration parameter.
512
513 * \#661 Fixed metadata caching on embedded documents.
514
515 * \#595 Fixed relation reload flagging.
516
517 * \#410 Moving documents from one relation to another now works as expected.
518
519 ## 2.1.7
520
521 This was a specific release to fix MRI 1.8.7 breakages introduced by 2.1.6.
522
523 ## 2.1.6
524
525 ### Resolved Issues
526
527 * \#1126 Fix setting of relations with other relation proxies.
528
529 * \#1122 Hash and array fields now properly flag as dirty on access and change.
530
531 * \#656 Fixed reload breaking relations on unsetting of already loaded associations.
532
533 * \#647 Prefer `#unset` to `#remove_attribute` for removing values.
534
535 * \#290 Verify pushes into deeply embedded documents.
536
537 ## 2.1.5
538
539 ### Resolved Issues
540
541 * \#1116 Embedded children retain reference to parent in destroy callbacks.
542
543 * \#1110, \#1115 Don't memoize metadata related helpers on documents.
544
545 * \#1112 `db:create_indexes` no longer indexes subclasses multiple times.
546
547 * \#1111, \#1098 Don't set `_id` in `$set` operations.
548
549 * \#1007 Update attribute properly tracks array changes.
550
551 ## 2.1.4
552
553 This was a specific release to get a Psych generated gemspec so no more parse errors would occur on those rubies that were using the new YAML parser.
554
555 ## 2.1.3
556
557 ### Resolved Issues
558
559 * \#1109 Fixed validations not loading one to ones into memory.
560
561 * \#1107 Mongoid no longer wants required `mongoid/railtie` in `application.rb`.
562
563 * \#1102 Fixed nested attributes deletion.
564
565 * \#1097 Reload now runs `after_initialize` callbacks.
566
567 * \#1079 Embeds many no longer duplicates documents.
568
569 * \#1078 Fixed array criteria matching on embedded documents.
570
571 * \#1028 Implement scoped on one-to-many and many-to-many relations.
572
573 * \#988 Many-to-many clear no longer deletes the child documents.
574
575 * \#977 Autosaving relations works also through nested attributes.
576
577 * \#972 Recursive embedding now handles namespacing on generated names.
578
579 * \#943 Don't override `Document#attributes`.
580
581 * \#893 Verify count is not caching on many to many relations.
582
583 * \#815 Verify `after_initialize` is run in the correct place.
584
585 * \#793 Verify `any_of` scopes chain properly with any other scope.
586
587 * \#776 Fixed mongoid case quality when dealing with subclasses.
588
589 * \#747 Fixed complex criteria using its keys to render its string value.
590
591 * \#721 `#safely` now properly raises validation errors when they occur.
592
593 ## 2.1.2
594
595 ### Resolved Issues
596
597 * \#1082 Alias `size` and `length` to `count` on criteria. (Adam Greene)
598
599 * \#1044 When multiple relations are defined for the same class, always return the default inverse first if `inverse_of` is not defined.
600
601 * \#710 Nested attributes accept both `id` and `_id` in hashes or arrays.
602
603 * \#1047 Ignore `nil` values passed to `embeds_man` pushes and substitution. (Derick Bailey)
604
605 ## 2.1.1
606
607 ### Resolved Issues
608
609 * \#1021, \#719 Many to many relations dont trigger extra database queries when pushing new documents.
610
611 * \#607 Calling `create` on large associations does not load the entire relation.
612
613 * \#1064 `Mongoid::Paranoia` should respect `unscoped` and `scoped`.
614
615 * \#1026 `model#update_attribute` now can update booleans to `false`.
616
617 * \#618 Crack XML library breaks Mongoid by adding `#attributes` method to the `String` class. (Stephen McGinty)
618
619 ## 2.1.0
620
621 ### Major Changes
622
623 * Mongoid now requires MongoDB 1.8.x in order to properly support the `#bit` and `#rename` atomic operations.
624
625 * Traditional slave support has been removed from Mongoid. Replica sets should be used in place of traditional master and slave setups.
626
627 * Custom field serialization has changed. Please see [serializable](https://github.com/mongoid/mongoid/blob/master/lib/mongoid/fields/serializable.rb) for changes.
628
629 * The dirty attribute tracking has been switched to use ActiveModel, this brings many bug fixes and changes:
630
631 * \#756 After callbacks and observers see what was changed instead of changes just made being in previous_changes
632
633 * \#434 Documents now are flagged as dirty when brand new or the state on instantiation differs from the database state. This is consistent with ActiveRecord.
634
635 * \#323 Mongoid now supports [field]_will_change! from ActiveModel::Dirty
636
637 * Mongoid model preloading in development mode now defaults to `false`.
638
639 * `:autosave => true` on relational associations now saves on update as well as create.
640
641 * Mongoid now has an identity map for simple `find_by_id` queries. See the website for documentation.
642
643 ### New Features
644
645 * \#1067 Fields now accept a `:versioned` attribute to be able to disable what fields are versioned with `Mongoid::Versioning`. (Jim Benton)
646
647 * \#587 Added order preference to many and many to many associations. (Gregory Man)
648
649 * Added ability to chain `order_by` statements. (Gregory Man)
650
651 * \#961 Allow arbitrary `Mongo::Connection` options to pass through `Mongoid::Config::Database` object. (Morgan Nelson)
652
653 * Enable `autosave` for many to many references. (Dave Krupinski)
654
655 * The following explicit atomic operations have been added: `Model#bit`, `Model#pop`, `Model#pull`, `Model#push_all`, `Model#rename`, `Model#unset`.
656
657 * Added exception translations for Hindi. (Sukeerthi Adiga)
658
659 ### Resolved Issues
660
661 * \#974 Fix `attribute_present?` to work correctly then attribute value is `false`, thanks to @nickhoffman. (Gregory Man)
662
663 * \#960 create indexes rake task is not recognizing a lot of mongoid models because it has problems guessing their model names from filenames. (Tobias Schlottke)
664
665 * \#874 Deleting from a M-M reference is one-sided. (nickhoffman, davekrupinski)
666
667 * Replace deprecated `class_inheritable_hash` dropped in Rails 3.1+. (Konstantin Shabanov)
668
669 * Fix inconsistent state when replacing an entire many to many relation.
670
671 * Don't clobber inheritable attributes when adding subclass field inheritance. (Dave Krupinski)
672
673 * \#914 Querying embedded documents with `$or` selector. (Max Golovnia)
674
675 * \#514 Fix marshaling of documents with relation extensions. (Chris Griego)
676
677 * `Metadata#extension` now returns a `Module`, instead of a `Proc`, when an extension is defined.
678
679 * \#837 When `allow_dynamic_fields` is set to `false` and loading an embedded document with an unrecognized field, an exception is raised.
680
681 * \#963 Initializing array of embedded documents via hash regressed (Chris Griego, Morgan Nelson)
682
683 * `Mongoid::Config.reset` resets the options to their default values.
684
685 * `Mongoid::Fields.defaults` is memoized for faster instantiation of models.
Something went wrong with that request. Please try again.