There is a method of writing SQL that matches the above site without distinguishing between uppercase and lowercase letters. Is it possible to write this using rails Arel?

The SQL statement I want

select * from member where namae collate utf8_unicode_ci like '% Sato%';

When using Arel, it is unclear how to describecollate utf8_unicode_ci.

Member.where (Member.arel_table [: namae] .matches ('% Sato%'))
  • Answer # 1

    Arel doesn't seem to have a collation setting function.

    Currently, Arel is part of the rails/rails repository, but if you searchcollatefor this, there was no hit from Arel.

Related articles