rails/rails — pull request #3868 by seanwalbran (2011-12-05 19:56:52+00:00)
Title: Has many through ids conditions

Fixes various github issues around has-many-through associations with conditions giving incorrect results when fetching _ids. (#3836, #2698, #2454, #1005)

- Added tests
- Backported ids_reader approach from 3.1/master.
- Let ids_reader bypass preload logic to work around 3.0 preloader issue with partially-loaded records (and preloading in an _ids fetch doesn't likely make performance sense anyway)
- Added except(:select) to exclude extraneous default select fields from through association scope