On 20 March 2010 09:57, Newb Newb <li...@ruby-forum.com> wrote:
> HEllo all,
>
> Kindly look into the below query
>
> @access_senders = GroupUser.find_by_sql "select distinct user_id from
> group_users where group_id in (SELECT group_id FROM group_users where
> user_id=2)"
>
> when i inspect the @access_senders i get the below
>
> [#<GroupUser user_id: 2>, #<GroupUser user_id: 41>, #<GroupUser user_id:
> 3518>,
> #<GroupUser user_id: 3519>, #<GroupUser user_id: 3520>, #<GroupUser
> user_id: 352
> 1>, #<GroupUser user_id: 3522>, #<GroupUser user_id: 3523>]
>
> now i want to append 3 into the above result set...#<GroupUser user_id:
> 3>

Can you provide the model relationships (has_many and so on) and what
you are trying to achieve in words rather than sql?

Colin

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to