I hope you all had a great Christmas.
My mail's subject says it all..
I've been in quite a lot situations where I wanted to join data from
another table "transparently", using scopes.
By transparently I mean that columns from the joined table are merged
into the result set as if they were attributes of the actual model.
SQL makes this possible with the SELECT statement, where you can do
"SELECT donors.*, model_translations.content AS name INNER JOIN
model_translations ON ...." so that a donor's name is actually fetched
from another table but still available for sorting etc.
Now to implement such a behavior we first need to add the JOIN
statement to the finder's SQL which is easy using dynamic scopes.
The SELECT, however can't easily be added because it would override
Rails' default "donors.*"..
I'm willing to hack a patch if there is no particular reason for this
implementation but I wanted to check beforehand.