Search the web
Sign In
New User? Sign Up
RubyOnRails · Ruby on Rails
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
hi everyone.. can someone help me here..   Message List  
Reply | Forward Message #21 of 107 |
hi there,

question with selecting in ruby on rails..
how do i get the
select..from.. not in (select table)

this is what i got for now..

@exist_persona_types = Persona.find(:all,
:select => "persona_type_id", #is a foreign of PersonaType
:conditions => [ "member_account_id = ?", session[:loggedin_user_id] ]
)

@remain_persona_types = PersonaType.find(:all,
:conditions => [ "id NOT IN (?)", [1] ] #hard coded
)


@exist_persona_types would get all the persona_type_id that a current
user already has then it should exclude it in the
@remain_persona_types. the problem is i cant get the array of the
@exist_persona_types.persona_type_id. so as of now, i just hard coded
the array of [1]..

can someone help

thanks thanks so much








Tue Mar 21, 2006 4:18 pm

animerei_12
Offline Offline
Send Email Send Email

Forward
Message #21 of 107 |
Expand Messages Author Sort by Date

hi there, question with selecting in ruby on rails.. how do i get the select..from.. not in (select table) this is what i got for now.. @exist_persona_types =...
animerei_12
Offline Send Email
Mar 22, 2006
6:38 am

nevermind this. i got the answer, i just made it in a query.. ehe @remain_persona_types = PersonaType.find_by_sql [ "SELECT * FROM persona_types WHERE id NOT...
animerei_12
Offline Send Email
Mar 27, 2006
3:22 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help