A
A
Andrey Demidenko2015-04-13 10:04:27
Ruby on Rails
Andrey Demidenko, 2015-04-13 10:04:27

How to apply lower in a database query for Russian characters?

SQLite3 database. There is a request.

Contract.where("lower(contractor) like :term or lower(subject_contract) like :term", term: "%#{term.mb_chars.downcase}%")

But lower case only works for English characters.
How to fulfill this request for Russian letters as well?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-04-13
@Dem1

# encoding: utf-8
at the beginning of the file is written?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question