Dynamic Find using LIKE

To covert "word_1 word_2" to "SELECT * FROM table WHERE term LIKE
'%word_1%' OR term LIKE '%word_2%' use Array's join method.

terms = "car boat train"

=> "car boat train"

terms = terms.split(" ")

=> ["car", "boat", "train"]

sqlWHERE = "term LIKE '%" << terms.join("%' OR term LIKE '%") + "%' "

=> "term LIKE '%car%' OR term LIKE '%boat%' OR term LIKE '%train%' "