Created
June 19, 2009 09:06
-
-
Save twilson63/132517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@people = People.find(:all) do | |
any do | |
if !criteria.numeric? | |
all do | |
first_name =~ criteria.split(' ')[0] + '%' | |
last_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 | |
end | |
all do | |
last_name =~ criteria.split(' ')[0] + '%' | |
first_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment