Skip to content

Search Controller relies on raw sql #11

@everett1992

Description

@everett1992

I quickly implemented a fuzzy search using SQL LIKE clause as follows

Podcast.where("title LIKE ?", "%#{params[:q]}%")

This isn't treated the same by all SQl implementations (i.e sqlite searches case insensitive, posgresql case sensitive). It's generally bad to use raw SQL instead of letting ActiveRecord, or a library handle it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions