Module: PGCrypto::AdapterMethods

Defined in:
lib/pgcrypto/adapter.rb

Constant Summary collapse

ADAPTER_NAME =
'PGCrypto'

Instance Method Summary collapse

Instance Method Details

#quote(*args, &block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/pgcrypto/adapter.rb', line 18

def quote(*args, &block)
  if args.first.is_a?(Arel::Nodes::SqlLiteral)
    args.first
  else
    super
  end
end

#to_sql(arel, *args) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pgcrypto/adapter.rb', line 26

def to_sql(arel, *args)
  case arel
  when Arel::InsertManager
    pgcrypto_insert(arel)
  when Arel::SelectManager
    pgcrypto_select(arel)
  when Arel::UpdateManager
    pgcrypto_update(arel)
  end
  super(arel, *args)
end