lib/tasks/default.rake
# Search for & print matching name.
# Presumes we are in a Rails environment
Search for & print matching name.
Presumes we are in a Rails environment
Search for & print matching name . Presumes we are in a Rails environment
def real_search_name(name)
  puts "Searching for name '#{name}' ignoring case; matching ids and names are:"
  name_downcase = name.downcase
  results = User.where('lower(name) LIKE ?', "%#{name_downcase}%")
                .select('id, name, encrypted_email, encrypted_email_iv')
                .pluck(:id, :name)
  puts results
  puts 'End of results.'
end
def real_search_name ( name ) puts "Searching for name '#{name}' ignoring case; matching ids and names are:" name_downcase = name . downcase results = User . where ( 'lower(name) LIKE ?' , "%#{name_downcase}%" ) . select ( 'id, name, encrypted_email, encrypted_email_iv' ) . pluck ( :id , :name ) puts results puts 'End of results.' end
Search for & print matching name.
Search for & print matching name .
name
<not_specific>