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 counter cache column name if :inverse_of is specified on belongs_to #4631

Closed
wants to merge 2 commits into from

Conversation

jm
Copy link
Contributor

@jm jm commented Jan 23, 2012

This gist explains what problem I'm fixing: https://gist.github.com/1665503

This patch adds a test and a small amount of code to fix the issue. Sorry for the stupid merging master commit. I can't seem to figure out how to get it to behave and don't have time to wrestle with git to fix it. :)

@jonleighton
Copy link
Member

This seems good to me but I am a little concerned about breaking existing code where people are relying on the current logic. @tenderlove wdyt?

@tenderlove
Copy link
Member

Seems fine for master. I don't think we should backport to 3-2-stable though.

@jonleighton
Copy link
Member

Alrighty. @jm could you add something to the CHANGELOG please?

@jm
Copy link
Contributor Author

jm commented Feb 19, 2012

Crap I didn't even see these comments until right now. I'll add something. Sorry about that.

@carlosantoniodasilva
Copy link
Member

@jm hey, would you mind adding that Changelog entry, so we can get this merged in? Thanks!

@@ -391,6 +391,20 @@ def test_custom_counter_cache
reply[:replies_count] = 17
assert_equal 17, reply.replies.size
end

def test_counter_cache_with_class_name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test could be test_counter_cache_with_inverse_of, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. That's a crappily named test. :)

@steveklabnik
Copy link
Member

@jm any chance you could update that test name and add a CHANGELOG entry so we can merge this?

@steveklabnik
Copy link
Member

Oh, and removing the merge commit would be good too.

@civrot
Copy link

civrot commented Nov 16, 2012

Feeling a little out place, but trying to help out the community at the same time. I came across this PR from http://issuetriage.herokuapp.com/, and just adding a comment to bring it up again.

@jm have you lost the energy behind this change? Should the PR be closed?

@steveklabnik
Copy link
Member

Yes, with two months and no answer, I'm giving it a close. @jm, you know how to re-open a new pull request if you think this is still a needed change.

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

6 participants