-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 7.0.1, 7.0.3, 7.0.4, 7.0.5
-
Component/s: Tests
-
None
-
Environment:Ruby version: 2.3.7
Mongoid gem : 6.4.4
Mongo gem : 2.6.4
Mongodb version: 4.0.13
Code Snippet:
scope :parents, lambda
{ where(parent_client_id: nil) }Error after upgrading mongoid gem from 6.4.4 to 7.0.1-7.0.5:
Failure:
ClientTest#test_0005_validation should fail when legacy storage is present but bad [/app/test/models/client_test.rb:56]:
[Mongoid::Errors::Validations] exception expected, not
Class: <SystemStackError>
Message: <"stack level too deep">
--Backtrace--
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:*****>'
app/models/cli***.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:****>' app/models/cli**.rb:87:in `block in <class:*****>'
-> This lambda is working fine till the mongoid version upgrade of 6.4.4
-> But the same lambda is throwing the above mentioned infinite loop error after upgrading to 7.0.1. ( It is the same behavior till the version 7.0.5 ).