Sha256: e5cc9c31625de091fb2f144caa36f4a2d10f4794502855551e92a0edf66016d6

Contents?: true

Size: 967 Bytes

Versions: 15

Compression:

Stored size: 967 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module SQLite3
      module Quoting # :nodoc:
        def quote_string(s)
          @connection.class.quote(s)
        end

        def quote_table_name_for_assignment(table, attr)
          quote_column_name(attr)
        end

        def quote_column_name(name)
          @quoted_column_names[name] ||= %Q("#{super.gsub('"', '""')}").freeze
        end

        def quoted_time(value)
          quoted_date(value)
        end

        def quoted_binary(value)
          "x'#{value.hex}'"
        end

        private

          def _type_cast(value)
            case value
            when BigDecimal
              value.to_f
            when String
              if value.encoding == Encoding::ASCII_8BIT
                super(value.encode(Encoding::UTF_8))
              else
                super
              end
            else
              super
            end
          end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
activerecord-5.1.5 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.5.rc1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.4 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.4.rc1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.3 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.3.rc3 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.3.rc2 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.3.rc1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.2 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.2.rc1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.0 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.0.rc2 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.0.rc1 lib/active_record/connection_adapters/sqlite3/quoting.rb
activerecord-5.1.0.beta1 lib/active_record/connection_adapters/sqlite3/quoting.rb