join with map would work here:
[[1, 2], [3, 4]].map{|inner| inner.join(", ")}
# => ["1, 2", "3, 4"]
[[1, 2], [3, 4]].map{|inner| inner.join(", ")}.join("),\n(")
# => "1, 2),\n(3, 4"
"(" + [[1, 2], [3, 4]].map{|inner| inner.join(", ")}.join("),\n(") + ")"
# => "(1, 2),\n(3, 4)"
puts "(" + [[1, 2], [3, 4]].map{|inner| inner.join(", ")}.join("),\n(") + ")"
# (1, 2),
# (3, 4)
Please note that this is a simple solution. In a production app, you would need to sanitize the array values [[1, 2], [3, 4]] if they were coming from untrusted sources (Users!) to avoid SQL injection attacks. But this seems to be out of the scope of this question.