Skip to content

HTTPS clone URL

Subversion checkout URL

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