Class: ActiveRecord::ConnectionAdapters::ReportingAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- ActiveRecord::ConnectionAdapters::ReportingAdapter
- 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
-
#initialize ⇒ ReportingAdapter
constructor
A new instance of ReportingAdapter.
-
#quote_string(s) ⇒ Object
Quotes a string, escaping any ‘ (single quote) and \ (backslash) characters.
- #quoted_false ⇒ Object
- #quoted_true ⇒ Object
Constructor Details
#initialize ⇒ ReportingAdapter
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_false ⇒ Object
16 17 18 |
# File 'lib/reporting/reporting_adapter.rb', line 16 def quoted_false "'0'" end |
#quoted_true ⇒ Object
12 13 14 |
# File 'lib/reporting/reporting_adapter.rb', line 12 def quoted_true "'1'" end |