Commit 7a53b1c
MONGOID-5105 Allow block form in Mongoid::Association::EmbedsMany::Proxy#count (#5060)
* MONGOID-5105 Mongoid::Association::EmbedsMany::Proxy should allow block form for #count to make it congruent with #any?, #none?, #all?, etc.
Example:
Person.addresses.count {|a| a.country == "FR" }
I've also added additional tests for other methods.
* MONGOID-5105 Update docs
* MONGOID-5105 Fix specs on Ruby 2.3 and 2.4
* MONGOID-5105 - .create --> .create! in spec
- Update docs
* MONGOID-5105 improve spec robustness
* MONGOID-5105 separate the tests
* MONGOID-5105 remove Ruby 2.5+ requirement
Co-authored-by: shields <shields@tablecheck.com>
Co-authored-by: Oleg Pudeyev <code@olegp.name>1 parent 5fcbce2 commit 7a53b1c
File tree
3 files changed
+378
-126
lines changed- lib/mongoid/association/embedded/embeds_many
- spec/mongoid/association
- embedded/embeds_many
- referenced/has_many
3 files changed
+378
-126
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
| |||
0 commit comments