I\'m fairly new and playing around with searching databases in Rails. I have a model and database that has a list of names under the \'name\' attribute. I want to be able to
formatted_columns = format_column_names(Sub.column_names) where(formatted_columns.map {|cn| "#{cn} like ?" }.join("or "), *(["%#{search}%"] * formatted_columns.size))
this takes care of all columns as well as the correct amount of fields