Skip to content

HTTPS clone URL

Subversion checkout URL

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