<commit_before>module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module Type
        class Date < ActiveRecord::Type::Date

          def sqlserver_type
            'date'.freeze
          end

          def serialize(value)
            return unless value.present?
            date = value.to_s(:_sqlserver_dateformat)
            Data.new date, self
          end

          def deserialize(value)
            value.is_a?(Data) ? super(value.value) : super
          end

          def type_cast_for_schema(value)
            serialize(value).quoted
          end

          def quoted(value)
            Utils.quote_string_single(value)
          end
<commit_msg>[Rails5] Fix `test_date_with_string_value` test.<commit_after>module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module Type
        class Date < ActiveRecord::Type::Date

          def sqlserver_type
            'date'.freeze
          end

          def serialize(value)
            return unless value.present?
            date = super(value).to_s(:_sqlserver_dateformat)
            Data.new date, self
          end

          def deserialize(value)
            value.is_a?(Data) ? super(value.value) : super
          end

          def type_cast_for_schema(value)
            serialize(value).quoted
          end

          def quoted(value)
            Utils.quote_string_single(value)
          end

{'fraction_non_alphanumeric': 0.06530898876404495, 'fraction_numerical': 0.0007022471910112359, 'mean_word_length': 1.7039848197343455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6539235', 'n_tokens_mistral': 386, 'n_tokens_neox': 370, 'n_words': 83}