You can clone with
No one assigned
I think I have a problem with reset_counters, but I need help knowing what information would be useful to diagnose the issue. I have been working on getting my application to use more cache counters and I successfully implemented several until reset_counters() just stopped working. I tried backing up to a previous revision when I knew it worked, and still nothing. I tried the standard new demo project with "Post" and "Comments" and that still failed. I upgraded from Rails 3.2.11 to 3.2.12 and it the same error occurred. It was working at one point, but now everything fails, so I think maybe the environment has something to do with it.
here is a gist of a new project I create to examine the problem, which includes the errors I have been getting : https://gist.github.com/ism/5166535
I don't know where the problem is coming from. I think if reset_counters was failing, more people would be yelling, but after the sample project, I don't see how it is my code either.
my dev environment is OSX 10.75 with ruby 1.9.3p392 and rails 3.2.12 .
I have pretty much wiped my environment and recreated it thinking it was something on my end.
Let me know what I can to do to make this more clear.
If you upload a sample application with the latest 3.2.x release (3.2.13.rc2) to github that I can check out I'll take a look.
Thanks. Here is what I was experimenting with: https://github.com/cgr/reset_counters_demo
I talked to @pixeltrix about this issue and he spotted that you are calling reset_counters with invalid parameters. As the documentation shows you should pass the association and not the column name of the counter:
As we can detect that the passed symbol is not working I'll add an error message to #reset_counters.
`#reset_counters` verifies counter names.
Raise an `ArgumentError` when the name of the counter does not
match an association name.
Thanks Senny. That explains why it magically stopped working. My brain fizzled out :P Sorry for the trouble, but I appreciate your help.