mrkamel / search_cop

Search engine like fulltext query support for ActiveRecord
MIT License
825 stars 39 forks source link

Use [:blank:] instead of \s for space #46

Closed kmdtmyk closed 5 years ago

kmdtmyk commented 5 years ago
class Book < ActiveRecord::Base
  include SearchCop

  search_scope :search do
    attributes :title
  end

end

Book.search("Harry Potter")

This works as follows.

WHERE books.title LIKE '%Harry%' AND books.title LIKE '%Potter%'

I expected same result to this argument. (separated by double-byte space)

Book.search("Harry Potter")

But, this actually works as follows.

WHERE books.title LIKE '%Harry Potter%'

I fixed it.

mrkamel commented 5 years ago

hi, thx for the PR and sry for the delay. I'm fine with it, but i will fix CI before merging.