Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix infinite loop by parent attr #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kmsheng
Copy link

@kmsheng kmsheng commented Jul 7, 2022

No description provided.

@apotonick
Copy link
Member

Thanks @kmsheng 💚 could you kindly add a test that provokes this bug, or give us an idea how you ran into this? We can help adding the formal test.

@kmsheng
Copy link
Author

kmsheng commented Jul 7, 2022

@apotonick Sure, my pleasure

@kmsheng
Copy link
Author

kmsheng commented Jul 7, 2022

@apotonick Please take a look at 1396f35 ,this test would fail at master branch.

@kmsheng
Copy link
Author

kmsheng commented Jul 7, 2022

And the error would be thrown as

Error:
ParentTest#test_0001_allows nested collection validation messages to be shown:
SystemStackError: stack level too deep
lib/reform/form/active_model.rb:92:in `new'
    lib/reform/form/active_model.rb:92:in `active_model_name_for'
    lib/reform/form/active_model.rb:87:in `model_name'
    lib/reform/form/active_model/validations.rb:31:in `block in active_model_really_sucks'
    lib/reform/form/active_model/validations.rb:30:in `active_model_really_sucks'
    lib/reform/form/active_model/validations.rb:170:in `full_messages'
    lib/reform/form/active_model/validations.rb:195:in `get_amv_errors'
    lib/reform/form/active_model/validations.rb:191:in `block in get_collection_errors'
    lib/reform/form/active_model/validations.rb:191:in `map'
    lib/reform/form/active_model/validations.rb:191:in `get_collection_errors'
    lib/reform/form/active_model/validations.rb:184:in `full_messages_for_twin'
    lib/reform/form/active_model/validations.rb:180:in `block in full_messages_for_nested_fields'
    lib/reform/form/active_model/validations.rb:180:in `each'
    lib/reform/form/active_model/validations.rb:180:in `map'
    lib/reform/form/active_model/validations.rb:180:in `full_messages_for_nested_fields'
    lib/reform/form/active_model/validations.rb:172:in `full_messages'
    lib/reform/form/active_model/validations.rb:195:in `get_amv_errors'
    lib/reform/form/active_model/validations.rb:185:in `full_messages_for_twin'
    lib/reform/form/active_model/validations.rb:180:in `block in full_messages_for_nested_fields'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants