简体   繁体   中英

How can I use lockbox gem with ransack gem?

Using Lockbox gem I encrypted my email column in the database but now I'm facing error when trying to use <%= f.search_field :email_cont %> . Please suggest me how can I handle it.

Error:

undefined method `email_cont' for Ransack::Search<class: User, base: Grouping <combinator: and>>:Ransack::Search

Unfortunately, it's not possible to use Ransack with Lockbox, since data encrypted at the application-level isn't searchable on the database-level / with SQL.

If Ransack could search arrays in addition to database models, this would be possible (but inefficient) since records could be loaded and decrypted, but looking through the Ransack code, it's not supported as of August 2020.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM