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

Eager loaded models not marked as read only #15853

Closed
jturkel opened this issue Jun 22, 2014 · 3 comments · Fixed by #18097
Closed

Eager loaded models not marked as read only #15853

jturkel opened this issue Jun 22, 2014 · 3 comments · Fixed by #18097

Comments

@jturkel
Copy link
Contributor

jturkel commented Jun 22, 2014

Eager loaded models aren't properly marked as readonly for read only associations.

See testcase in https://gist.github.com/jturkel/7e39d519f9e017d4e4b5

@senny
Copy link
Member

senny commented Jun 22, 2014

I can confirm this issue. Happens to both preloaded and eager_loaded associations.

senny added a commit that referenced this issue Jun 25, 2014
This is a partial fix for #15853. It only works when a `preload`
is issued and not an `eager_load`. I've added a skipped failing
test-case to keep in mind that we need to deal with `eager_load`.
@senny
Copy link
Member

senny commented Jun 25, 2014

I pushed a partial fix for this issue 5706d29

It's partial because the fix only applies to preload and not to eager_load. This means that it will work for includes by default but not when you reference columns from eager loaded associations.

Let's keep the issue open until we have eager_load figured out as well. There is a skipped test in the codebase that currently fails.

@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

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

Successfully merging a pull request may close this issue.

3 participants