Say I have a string : "012345678".
I have a column in a table which also stores strings. I want to find all
rows which match that string of numbers in that order.
That is, "012345678" will match, but "012-34-5678" will, and
"012sneeze345bless67you8thanks" also will.

Do I have to do something like:
ThisIsMyString = "012345678"
fits = Patient.all.find { |a| a.identifier.delete("^[0-9]") ==
ThisIsMyString }

.. Or can I do something WITHOUT getting all the data, a kind of
Patient.find but with a tweak on the sql query?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to