Skip to content

Fix surveys n+1#3493

Merged
oriolgual merged 5 commits into0.11-stablefrom
fix/surveys-n1
May 25, 2018
Merged

Fix surveys n+1#3493
oriolgual merged 5 commits into0.11-stablefrom
fix/surveys-n1

Conversation

@mrcasals
Copy link
Copy Markdown
Contributor

🎩 What? Why?

We found a N+1 in surveys, where it was loading all the survey answers when rendering the survey form. This is due to how rectify forms work: if you have an attribute to the form, and its model responds to that attribute, the form will automatically call . this method.

This meant that if a form had an attribute called :answers, it automatically calls model.answers. In our case, it was causing the app to load all the answers for the given survey, which caused memory problems.

📌 Related Issues

None

📋 Subtasks

  • Add CHANGELOG entry

@mrcasals mrcasals added in-review backport Pull Requests that are a backport for a fixed bug lot: core labels May 24, 2018
@mrcasals mrcasals self-assigned this May 24, 2018
@ghost ghost added the status: WIP label May 24, 2018
@mrcasals
Copy link
Copy Markdown
Contributor Author

This will need to be ported to master.

@ghost ghost added the status: WIP label May 24, 2018
@oriolgual oriolgual merged commit dc0f48a into 0.11-stable May 25, 2018
@oriolgual oriolgual deleted the fix/surveys-n1 branch May 25, 2018 07:10
mrcasals added a commit that referenced this pull request May 25, 2018
* Fix surveys n+1

* Fix specs

* Fix tests

* Fix tests

* Lint files
@mrcasals mrcasals mentioned this pull request May 25, 2018
1 task
rbngzlv added a commit that referenced this pull request May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Pull Requests that are a backport for a fixed bug in-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants