This project is archived and is in readonly mode.

#1102 ✓committed
Ernie Miller

Added :counter_sql to valid keys for HABTM

Reported by Ernie Miller | September 24th, 2008 @ 02:37 PM | in 2.x

In #831, I submitted a patch to refactor AssociationCollection#count and fix problems with HABTM count in Ruby 1.8.7. I forgot to add :counter_sql to the list of valid keys for HABTM associations in associations.rb, as Tekin pointed out. This was causing the option to be rejected despite the documentation update stating it should work. This one-liner patch fixes that. Sorry!

(If someone wants to add a new fixture that is a HABTM association with a :counter_sql option and put in a test making sure it counts, it probably would be worthwhile. I just don't have the time to do that today, and wanted to get this in before the bug makes it into 2.2 beta.)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages