Skip to content

Commit b4416d0

Browse files
MONGOID-5422 - Configuration DSL should not require an argument to its block (Rails parity) (#5367)
* MONGOID-5422 - Configuration DSL no longer requires an argument to its block * More terse syntax * Use config_override * Update docs/release-notes/mongoid-8.1.txt Co-authored-by: shields <shields@tablecheck.com> Co-authored-by: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com>
1 parent b6e19bb commit b4416d0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

source/release-notes/mongoid-8.1.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,31 @@ please consult GitHub releases for detailed release notes and JIRA for
1818
the complete list of issues fixed in each release, including bug fixes.
1919

2020

21+
Configuration DSL No Longer Requires an Argument to its Block
22+
-------------------------------------------------------------
23+
24+
It is now possible to use ``Mongoid.configure`` without
25+
providing an argument to its block:
26+
27+
.. code-block:: ruby
28+
29+
Mongoid.configure do
30+
connect_to("mongoid_test")
31+
32+
# Use config method when assigning variables
33+
config.preload_models = true
34+
35+
Note that ``configure`` will continue to support a block argument.
36+
The following is equivalent to the above:
37+
38+
.. code-block:: ruby
39+
40+
Mongoid.configure do |config|
41+
config.connect_to("mongoid_test")
42+
43+
config.preload_models = true
44+
45+
2146
Added ``Mongoid::Criteria`` finder methods
2247
------------------------------------------
2348

0 commit comments

Comments
 (0)