make mephisto search case insensitive
January 25th, 2009
small hack applies to mephisto 0.8.1.
around line 76 in mephisto_controller.rb the case sensitive code…
conditions = ['(published_at IS NOT NULL AND published_at <= :now) AND (title LIKE :q OR excerpt LIKE :q OR body LIKE :q)',
has to become…
conditions = ['(published_at IS NOT NULL AND published_at <= :now) AND (lower(title) LIKE lower(:q) OR lower(excerpt) LIKE lower(:q) OR lower(body) LIKE lower(:q))',
this downcases all strings before comparing.