Module: AttrEncryptedPgcrypto::LogSubscriber::PostgresPgp

Defined in:
lib/attr_encrypted_pgcrypto/log_subscriber/postgres_pgp.rb

Instance Method Summary collapse

Instance Method Details

#sql(event) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/attr_encrypted_pgcrypto/log_subscriber/postgres_pgp.rb', line 7

def sql(event)
  filter = /(pgp_sym_(encrypt|decrypt))\(((.|\n)*?)\)/i

  event.payload[:sql] = event.payload[:sql].gsub(filter) do |_|
    "#{$1}([FILTERED])"
  end

  super
end