Array variable inside a find statement

I’ve got an array that I want to use to access a database with. I want
to execute a command like:

@people = Person.find([3, 5, 7])

but use an array variable inside the find. When I try this:

ids = Array.new()
ids << 3
ids << 5
ids << 7

@people = Person.find(#{ids})

The output turns out to be:

@people = Person.find(357)

Is there a way to retain the array without it being concatenated into a
string?

-Anthony

yours should work fine if you didn’t convert it into a string!

ids = Array.new()
ids << 3
ids << 5
ids << 7
@people = Person.find(ids)

On Dec 12, 1:41 pm, Anthony W. [email protected]

@some = [1,2]
@people = Person.find @some