<commit_before>module ActiveRecord
  module OracleEnhanced
    module Type
      class Boolean < ActiveModel::Type::Boolean # :nodoc:
        # Add 'N' as FALSE_VALUES
        FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF', 'n', 'N'].to_set

        private

        def cast_value(value)
          # Not calling super to use its own `FALSE_VALUES`
          if value == ''
            nil
          else
            !FALSE_VALUES.include?(value)
          end
        end

      end
    end
  end
end<commit_msg>Refactor Boolean type by removing duplicate code<commit_after>module ActiveRecord
  module OracleEnhanced
    module Type
      class Boolean < ActiveModel::Type::Boolean # :nodoc:

        private

        def cast_value(value)
          # Kind of adding 'n' and 'N' to  `FALSE_VALUES`
          if ['n', 'N'].include?(value)
            false
          else
            super
          end
        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09381443298969072, 'fraction_numerical': 0.002061855670103093, 'mean_word_length': 1.80635838150289, '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': '928409', 'n_tokens_mistral': 286, 'n_tokens_neox': 280, 'n_words': 86}