Sha256: c9fa7d17f4c1fe360ace6d6dad83434ad420c051ca3c65e8cb835c60f59ef58b

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module Type
        class Char < String

          def type
            :char
          end

          def type_cast_for_database(value)
            return if value.nil?
            return value if value.is_a?(Data)
            Data.new(super)
          end

          class Data

            def initialize(value)
              @value = value.to_s
            end

            def quoted
              "'#{@value}'"
            end

          end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-4.2.12 lib/active_record/connection_adapters/sqlserver/type/char.rb
activerecord-sqlserver-adapter-4.2.11 lib/active_record/connection_adapters/sqlserver/type/char.rb