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 for #5200 #5210

Closed
wants to merge 2 commits into from
Closed

Fix for #5200 #5210

wants to merge 2 commits into from

Conversation

davedesro
Copy link
Contributor

reset_counters() was crashing when there were multiple belongs_to associations with the same foreign key.. with only one of the belongs_to associations having a custom counter_cache.

reset_counters() made the false assumption that each belongs_to association has a counter_cache.

@steveklabnik
Copy link
Member

This doesn't merge properly any longer, mind updating it for HEAD?

@davedesro
Copy link
Contributor Author

Ok, I merged the changes. Let me know if you need anything else from me. thanks!

@steveklabnik
Copy link
Member

I'm not allowed to merge this, but yes, it merges cleanly now, thanks! It's all in @tenderlove or @jonleighton's hands now.

@schneems
Copy link
Member

schneems commented Aug 6, 2012

3 months old PR, the fix looks straightforward, tests are included. Can we get some love from AR?

@rafaelfranca
Copy link
Member

This seems fine, but needs a rebase.

@davedesro
Copy link
Contributor Author

@rafaelfranca I rebased it. Please let me know if you need anything else. thanks.

rafaelfranca added a commit that referenced this pull request Aug 21, 2012
@rafaelfranca
Copy link
Member

Done

rafaelfranca added a commit that referenced this pull request Aug 21, 2012
Fix for #5200

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
MacksMind added a commit to MacksMind/rails that referenced this pull request Mar 17, 2013
PR rails#5210 added a Friendship model to illustrate a bug, but in doing so
created a confusing structure because both belongs_to declarations in
Friendship referred to the same side of the join. The new structure
maintains the integrity of the bug test while changing the follower
relationship to be more useful for other testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants