module ActiveRecord::ConnectionAdapters::SQLite3::Quoting
def quote(value) # :nodoc:
def quote(value) # :nodoc: case value when Numeric if value.finite? super else "'#{value}'" end else super end end
def quote_default_expression(value, column) # :nodoc:
def quote_default_expression(value, column) # :nodoc: if value.is_a?(Proc) value = value.call if value.match?(/\A\w+\(.*\)\z/) "(#{value})" else value end else super end end
def quote_string(s)
def quote_string(s) ::SQLite3::Database.quote(s) end
def quote_table_name_for_assignment(table, attr)
def quote_table_name_for_assignment(table, attr) quote_column_name(attr) end
def quoted_binary(value)
def quoted_binary(value) "x'#{value.hex}'" end
def quoted_false
def quoted_false "0" end
def quoted_time(value)
def quoted_time(value) value = value.change(year: 2000, month: 1, day: 1) quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "2000-01-01 ") end
def quoted_true
def quoted_true "1" end
def type_cast(value) # :nodoc:
def type_cast(value) # :nodoc: case value when BigDecimal, Rational value.to_f when String if value.encoding == Encoding::ASCII_8BIT super(value.encode(Encoding::UTF_8)) else super end else super end end
def unquoted_false
def unquoted_false 0 end
def unquoted_true
def unquoted_true 1 end