Skip to content

Commit 33f2340

Browse files
p-mongop
andauthored
MONGOID-5327 document behavior change in release notes (#5258)
Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 633327d commit 33f2340

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/release-notes/mongoid-8.0.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,37 @@ as well as ActiveRecord-compatible ``previously_new_record?`` and
272272
user.previously_persisted? # => true
273273

274274

275+
Unknown Field Type Symbols/Strings Prohibited
276+
---------------------------------------------
277+
278+
Mongoid 8 prohibits using symbols and strings as field types when these symbols
279+
and strings do not map to a known type. Previously such usage would create a
280+
field of type ``Object``.
281+
282+
Mongoid 8 behavior:
283+
284+
.. code-block:: ruby
285+
286+
class User
287+
include Mongoid::Document
288+
289+
field :name, type: :bogus
290+
# => raises Mongoid::Errors::InvalidFieldType
291+
end
292+
293+
Mongoid 7 behavior:
294+
295+
.. code-block:: ruby
296+
297+
class User
298+
include Mongoid::Document
299+
300+
field :name, type: :bogus
301+
# Equivalent to:
302+
field :name
303+
end
304+
305+
275306
Removed ``Document#to_a`` method
276307
--------------------------------
277308

0 commit comments

Comments
 (0)