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

Iterate arrays when freezing to avoid reference issues #28

Merged
merged 1 commit into from
Jun 23, 2015

Conversation

hkdobrev
Copy link
Contributor

When iterating an association and perform an action which could access the parent model and then the same association is accessed by reference and nesting foreach loops is causing the internal pointer of the Iterator to move so the outer loop iteration is executed only once.

This may cause in multi-brand-purchase scenario, only some of purchase items to be frozen depending on the actions performed by the freeze.

When iterating an association and perform an action
which could access the parent model and then the same association
it is accessed by reference and nesting `foreach` loops
is causing the internal pointer of the Iterator to move
so the outer loop iteration is executed only once.

This may cause in multi-brand-purchase scenario,
only some of purchase items to be frozen
depending on the actions performed by the freeze.
@dkyosev
Copy link
Contributor

dkyosev commented Jun 23, 2015

LGTM

hkdobrev added a commit that referenced this pull request Jun 23, 2015
Iterate arrays when freezing to avoid reference issues
@hkdobrev hkdobrev merged commit 7de26e9 into master Jun 23, 2015
@hkdobrev hkdobrev deleted the fix-freeze-iterators branch June 23, 2015 10:58
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.

None yet

2 participants