Rails: combining multiple find requests

Posted by peppermonkey on Stack Overflow See other posts from Stack Overflow or by peppermonkey
Published on 2010-05-14T08:21:47Z Indexed on 2010/05/14 8:24 UTC
Read the original article Hit count: 206

Filed under:
|
|
|

What I want to do is something like this:

searchid = 4

while searchid != -1

  @a += A.find(searchid)
  @b = B.find(searchid)
  searchid = @b.parentid
end

The problem being the line

@a += A.find(searchid)

The error being something like

NoMethodError: undefined method `+' for #

So, how do you combine multiple 'find' requests?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about find