Skip to content

Commit

Permalink
Prep for v8.0.6 (#5682)
Browse files Browse the repository at this point in the history
* version bump

* add release notes for the `allow_bson5_decimal128` config option

* don't use docker due to rate limiting
  • Loading branch information
jamis committed Aug 24, 2023
1 parent aa31dc9 commit 35d0c63
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ functions:
DRIVER="${DRIVER}" \
I18N="${I18N}" \
TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}" \
./egos .evergreen/run-tests-docker.sh
./egos .evergreen/run-tests.sh
"fix absolute paths":
- command: shell.exec
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config/commands.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ functions:
DRIVER="${DRIVER}" \
I18N="${I18N}" \
TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}" \
./egos .evergreen/run-tests-docker.sh
./egos .evergreen/run-tests.sh

"fix absolute paths":
- command: shell.exec
Expand Down
37 changes: 37 additions & 0 deletions docs/release-notes/mongoid-8.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -767,3 +767,40 @@ Support for individually caching criteria objects has been dropped in Mongoid 8.

In order to get caching functionality, enable the Mongoid Query Cache. See the
section on :ref:`Query Cache <query-cache>` for more details.


BSON 5 and BSON::Decimal128 Fields
----------------------------------

When BSON 4 or earlier is present, any field declared as BSON::Decimal128 will
return a BSON::Decimal128 value. When BSON 5 is present, however, any field
declared as BSON::Decimal128 will return a BigDecimal value by default.

.. code-block:: ruby

class Model
include Mongoid::Document

field :decimal_field, type: BSON::Decimal128
end

# under BSON <= 4
Model.first.decimal_field.class #=> BSON::Decimal128

# under BSON >= 5
Model.first.decimal_field.class #=> BigDecimal

If you need literal BSON::Decimal128 values with BSON 5, you may instruct
Mongoid to allow literal BSON::Decimal128 fields:

.. code-block:: ruby

Model.first.decimal_field.class #=> BigDecimal

Mongoid.allow_bson5_decimal128 = true
Model.first.decimal_field.class #=> BSON::Decimal128

.. note::

The ``allow_bson5_decimal128`` option only has any effect under
BSON 5 and later. BSON 4 and earlier ignore the setting entirely.
2 changes: 1 addition & 1 deletion lib/mongoid/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Mongoid
VERSION = "8.0.5"
VERSION = "8.0.6"
end

0 comments on commit 35d0c63

Please sign in to comment.