Name |
Last commit
|
Last Update |
---|---|---|
lib | ||
test | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
Gemfile | ||
LICENSE | ||
README.md | ||
Rakefile | ||
paranoia.gemspec |
This is a workaround actually. Since `ActiveRecord::CounterCache.each_counter_cached_associations` is private. We shouldn’t use it. Proposals for the proper fix are welcome. The reason the previous version stopped working is `affected_rows` returns `0` at [active_record/counter_cache.rb#L142](https://github.com/rails/rails/blo b/ef99d4cd3ecc58a8c1484740b2fb5447dbda23ab/activerecord/lib/active_recor d/counter_cache.rb#L142). If you follow the method call you’ll find that it’s called at [active_record/persistence.rb#L486](https://github.com/rails/rails/blob/ ef99d4cd3ecc58a8c1484740b2fb5447dbda23ab/activerecord/lib/active_record/ persistence.rb#L486). Probably we’d better override the return value in `ActiveRecord::Relation.delete_all` at [active_record/relation.rb#L481](https://github.com/rails/rails/blob/ef9 9d4cd3ecc58a8c1484740b2fb5447dbda23ab/activerecord/lib/active_record/rel ation.rb#L481).
Name |
Last commit
|
Last Update |
---|---|---|
lib | Loading commit data... | |
test | Loading commit data... | |
.gitignore | Loading commit data... | |
.travis.yml | Loading commit data... | |
CHANGELOG.md | Loading commit data... | |
Gemfile | Loading commit data... | |
LICENSE | Loading commit data... | |
README.md | Loading commit data... | |
Rakefile | Loading commit data... | |
paranoia.gemspec | Loading commit data... |