This project is archived and is in readonly mode.
ActiveRecord::Base.find mixed array of Strings and Symbols for :joins option
-
David Trasbo
+1
I can definitely see cases where this patch would come in handy. Also, it makes the
:joinsoption behave like you would expect it. -
Will Bryant
Guys, is this still needed with 3.0's new arel-based join goodness? The new query building lets you specify the joins one by one building on the relations, so AFAIK you won't need this feature any more.
-
Uwe Kubosch
- Importance changed from to
2.3 will be around for a long time, and the "old" way of calling find with :joins will be used for a long time.
The patch is very small and simple. Please add this patch.
-
EJ Finneran
Also, whether the patch goes in or not, I noticed that the Rails 2.3 docs claim this is already supported:
http://railsapi.com/doc/v2.3.2/
:joins - Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed), named associations in the same form used for the :include option, which will perform an INNER JOIN on the associated table(s), or an array containing a mixture of both strings and named associations. If the value is a string, then the records will be returned read-only since they will have attributes that do not correspond to the table‘s columns. Pass :readonly => false to override.
-
rails
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
