Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9734 (closed defect: fixed)

Opened 1 year ago

Last modified 1 month ago

[PATCH] Make size for has_many :through use counter cache if it exists

Reported by: xaviershay Assigned to: core
Priority: normal Milestone: 1.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: has_many through size
Cc:

Description

HasManyThroughAssociation#size does not currently use a counter cache (i.e. comments_count) defined on the owner table.

This is unexpected because it differs from normal has_many behaviour, and results in unexpected COUNTs being sent to the DB.

Attached patch adds this functionality.

Attachments

has_many_through_size_use_counter_cache_r7675.diff (2.0 kB) - added by xaviershay on 09/29/07 05:24:40.

Change History

09/29/07 05:24:40 changed by xaviershay

  • attachment has_many_through_size_use_counter_cache_r7675.diff added.

09/30/07 06:47:24 changed by rick

  • status changed from new to closed.
  • resolution set to fixed.

(In [7692]) Make size for has_many :through use counter cache if it exists. Closes #9734 [xaviershay]

09/15/08 05:17:15 changed by china

by end users who would like to contribute and start to use docs to learn cool stuff about their apps in the first place. Both annotations and contributions will only clutter the interface by default as a design pattern rather than trying to put it all together. That way you can never create offline or print docs of high quality without again having the devs or current admins maintain the comments and annotations. Hopefully a small Wiki quality team will evolve (i am against ops or admins) to review and summarize the contributions. I hope this gives us more users as contributors than having the docs focused on the devs. Cheers, duns china tour I still prefer a wiki like approach since the php (or mysql) docs are very cluttered when you have to take their comments in account. On the other hand they are professionally maintained imho, since they are *much* better than KDE documentation. KDE is by far larger and has so many different apps, which need screenshots and end user not dev/api docs