On K, 2007-07-04 at 11:49 -0700, Jeremy Evans wrote:
> You can already do what you want (assuming it hasn't changed since
> 1.2.3), but it is ugly:
>
> :conditions=>'#{"#{aliased_table_name}." rescue ""}attribute = value'
>
> You need the rescue because aliased_table_name isn't available when
> doing lazy loading (it used to be before Rails 1.2).
>
> Jeremy
I actually tried this but without the rescue. It indeed appears to work,
at least with edge rails.
But still, shouldn't there be a more natural way for doing this?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---