Expanding an array parameter?

Hi everyone,

I am wondering if there is a way to pass a function an array, but have
it treated as if it was expanded.

Here is an example of what I am trying to do:

query_string = "param1 = ? AND param2 = ?"
parameters = [1,"test"]

Thing.find :all, :conditions => [query_string, parameters]

Is there a way to do something like this? A way to have the parameters
variable treated like an expanded array?

Thank you for your time,

JD

<...>

Thing.find :all, :conditions => [query_string, parameters]

Is there a way to do something like this? A way to have the parameters
variable treated like an expanded array?

<...>

You can expand array to values using * (splat).

Try: Thing.find :all, :conditions => [query_string, *parameters]

Regards,
Rimantas