Sha256: 76f4861c03774fd7b5c5f6863651eb006e43febd9ccdd3d2dab09d10bf0ca9b9

Contents?: true

Size: 991 Bytes

Versions: 24

Compression:

Stored size: 991 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module MySQL
      module Quoting # :nodoc:
        QUOTED_TRUE, QUOTED_FALSE = '1'.freeze, '0'.freeze

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

        def quote_table_name(name)
          @quoted_table_names[name] ||= super.gsub('.', '`.`')
        end

        def quoted_true
          QUOTED_TRUE
        end

        def unquoted_true
          1
        end

        def quoted_false
          QUOTED_FALSE
        end

        def unquoted_false
          0
        end

        def quoted_date(value)
          if supports_datetime_with_precision?
            super
          else
            super.sub(/\.\d{6}\z/, '')
          end
        end

        private

        def _quote(value)
          if value.is_a?(Type::Binary::Data)
            "x'#{value.hex}'"
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
activerecord-5.0.7.2 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.7.1 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.7 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.6 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.6.rc1 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.5 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.5.rc2 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.5.rc1 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.4 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.4.rc1 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.3 lib/active_record/connection_adapters/mysql/quoting.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-5.0.2/lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.2 lib/active_record/connection_adapters/mysql/quoting.rb
activerecord-5.0.2.rc1 lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/quoting.rb