It''s possible to do that ?
a = ["profiles.band" => "bolo",
"users.irst_name" => "bolo"]
User.find(:all,
:include => a,
:conditions=>a)
On 6 mai, 08:44, Bolo <mala...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello
>
> I would like to use hash in my condition
>
> 1. User.find(:all, :conditions=>{:first_name =>
''akhil'', :role =>
> ''admin''})
>
> it''s working
>
> User.find(:all,
> :include => :profile,
> :conditions=>{:band => ''bolo'',
:first_name =>
> ''akhil'', :role => ''admin''})
>
> When i try this will generate this SQL
> WHERE (users."band" = ''bolo'' AND
users."first_name" = ''''akhil'' AND
> users."role" = ''admin'')
>
> But i would like the finder generate this SQL
> WHERE (profiles."band" = ''bolo'' AND
users."first_name" = ''''akhil'' AND
> users."role" = ''admin'')
>
> How i can do that ?
>
> Bolo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---