Comments (3)
Hah! That was a fun little distraction. Fixed in 0.1.10. Not sure about the wisdom of triggering an update on the same model instance in an after_create. But, hey, this fix doesn't hurt other use cases, so why not.
In case you are curious: The update_column you did from within after_create fired a separate call to counter_culture's after_update, but all within the same save. That triggered another increment. I'm now checking for that specifically.
from counter_culture.
Awesome, thank you so much and thanks for responding so quickly. You got that done quick!
I'm totally in agreement on the update after save (this particular instance was a strange edge case dealing with a legacy schema).
I thought it might be something like that, I'll check out the changes you made and see how you fixed it so maybe I can help in the future.
Thanks again!
from counter_culture.
Happy to help! This is the commit that fixes this, in case you are curious:
bestvendor/counter_culture@6cd8491
On Wed, Mar 27, 2013 at 4:37 PM, Dan Ahern [email protected] wrote:
Awesome, thank you so much and thanks for responding so quickly. You got
that done quick!I'm totally in agreement on the update after save (this particular
instance was a strange edge case dealing with a legacy schema).I thought it might be something like that, I'll check out the changes you
made and see how you fixed it so maybe I can help in the future.Thanks again!
—
Reply to this email directly or view it on GitHubhttps://github.com/bestvendor/counter_culture/issues/11#issuecomment-15551531
.
from counter_culture.
Related Issues (20)
- How to decrement count when an attribute value changes? HOT 1
- Request: Callback support on parent models HOT 1
- Multiple counters, single query HOT 4
- Incorrect count when using ID in the dynamic column name proc HOT 2
- Model.counter_culture_fix_counts does nothing after the initial run HOT 1
- How to update with habtm when products have conditions? HOT 8
- Multi-level association 3-deep works in the console, but fails every test and in production HOT 3
- counter_culture_fix_counts with where clause HOT 2
- Two counters of the same model, one scoped the other not HOT 1
- jsonb support HOT 1
- what is the drawback of using active records callback instead this gem? HOT 1
- PG::UndefinedColumn: ERROR: column "nan" does not exist HOT 3
- Add "where" option to the `counter_culture` method HOT 1
- STI and Polymorphic issue with fix counts method on self-referential models HOT 4
- Updating counts is associations active HOT 1
- Dynamic column name that uses model primary key causes all updates to increment the counter HOT 2
- Column_names not accepting proc with hash HOT 1
- Call to `previous_model` is triggering `transaction_changed_attributes` callbacks causing changes to be overwritten HOT 5
- Undefined Method `current_time_from_proper_timezone' Error HOT 1
- Adding :if / :unless for conditional counter caches HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from counter_culture.