Hey guys! First time posting so let see how this goes… got a question:
I’m trying to find a record in a table minus any leading / trailing
whitespaces.
This code will find the record but it wont return anything if the
value in the table’s column (named MyColumn) had any whitespaces at
the beginning or at the end of it:
found_record = MyTable.find(:first,:conditions => [ “MyColumn = ?”,
someValue ])
I tried this and it obviously didnt work:
found_record = MyTable.find(:first,:conditions => [ “MyColumn.strip =
?”, someValue ])
I dont wanna modify the data in the table, just find a match.
What can I do? Thanks!