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
Set updated_at when executing counter_culture_fix_counts #210
Comments
Currently, as I workaround, in a migration, I'd put |
Yeah, that makes sense. Feel free to submit a PR. 😄 |
@magnusvk I'm willing to submit a PR. What I've done so far:
I get the following failure: Failures:
1) CounterCulture should fix a STI counter cache correctly
Failure/Error: expect(company.twitter_reviews_count).to eq(1)
expected: 1
got: 0
(compared using ==)
# ./spec/counter_culture_spec.rb:1018:in `block (2 levels) in <top (required)>'
Finished in 2.31 seconds (files took 1.55 seconds to load)
35 examples, 1 failure
Failed examples:
rspec ./spec/counter_culture_spec.rb:1003 # CounterCulture should fix a STI counter cache correctly After some investigation I found out that the failure is cause by the # TwitterReview
counter_culture [:user, :manages_company] that is, I move it from Before I continue my investigation - can you tell me if the test fails on your side as well? I'm running ruby 2.4.1 and rails 5.1.5. https://github.com/magnusvk/counter_culture/blob/master/lib/counter_culture/extensions.rb#L78 |
O.K., this does not happen on 5.1.4., it only happens on 5.1.5. I think the problem is somehow related to rails/rails#27780 |
Yeah, this used to work fine with Rails 5.1. I haven’t had a chance to look into this yet but will try to soon. Thanks for digging. For purposes of your PR feel free to just test against 5.1.4 for now where the test is green. |
Fixed by #212 |
and
I think in this case also the
updated_at
field of thefoos
needs to be updated.Does this make sense to you?
The text was updated successfully, but these errors were encountered: