module CryptKeeperWithRansack::Ransack::ClassMethods

Public Instance Methods

add_crypt_ransacker(field, key: nil) click to toggle source
# File lib/crypt_keeper_with_ransack.rb, line 28
def add_crypt_ransacker(field, key: nil)
  ransacker field do |parent|
    Arel.sql "pgp_sym_decrypt(cast(#{field} AS bytea), '#{key}')"
  end
end