On 7/5/07, Chris Cruft <[EMAIL PROTECTED]> wrote:
>
> I've run into problems trying to anticipate the aliased table name as
> well.  I think Rails should have a more consistent way to refer to
> aliased table names.  Perhaps a parameter to the association
> definition?

The problem isn't determining the table alias during eager loading (it's
aliased_table_name), the problem is setting it correctly during lazy
loading.  Some of the internal API needs to be changed to support it.
I think ActiveRecord::Base#interpolate_sql is the function that
evaluates the strings, so that is the function that needs to supply
aliased_table_name.  It works for eager loading because eager loading
uses 
ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation#interpolate_sql.

Jeremy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to