This project is archived and is in readonly mode.

#239 ✓resolved
Andrew White

Change :select precedence in construct_finder_sql to favor options[:select]

Reported by Andrew White | May 22nd, 2008 @ 03:32 PM

Currently construct_finder_sql gives precedence to the :select from the current scope over :select passed in the options parameter. Not only is this counterintuitive it makes it harder to optimize performance by reducing the columns returned or to construct sql within the context of one model and then feed it into find_by_sql in another model.

The attached patch simply switches the order in construct_finder_sql and adds a couple of tests to check that construct_finder_sql respects the :select option

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>

People watching this ticket

Attachments

Pages