Class: ActiveRecord::ConnectionAdapters::ReportingAdapter

Inherits:
AbstractAdapter
  • Object
show all
Defined in:
lib/reporting/reporting_adapter.rb

Overview

This connection adapter does the quoting the way our reporting class should generate it

Instance Method Summary collapse

Constructor Details

#initializeReportingAdapter

Returns a new instance of ReportingAdapter.



8
9
10
# File 'lib/reporting/reporting_adapter.rb', line 8

def initialize
  super(nil)
end

Instance Method Details

#quote_string(s) ⇒ Object

Quotes a string, escaping any ‘ (single quote) and \ (backslash) characters.



22
23
24
# File 'lib/reporting/reporting_adapter.rb', line 22

def quote_string(s)
  s.gsub(/\\/, '\&\&').gsub(/'/, "\\\\'") # ' (for ruby-mode)
end

#quoted_falseObject



16
17
18
# File 'lib/reporting/reporting_adapter.rb', line 16

def quoted_false
  "'0'"
end

#quoted_trueObject



12
13
14
# File 'lib/reporting/reporting_adapter.rb', line 12

def quoted_true
  "'1'"
end