<commit_before>module RailsAdmin
  module Extensions
    module MongoidAudit
      class VersionProxy
        def initialize(version)
          @version = version
        end

        def message
          @message = @version.action
          if @message == 'create'
            return I18n.t('audit.create') #'new'
          end
          if @message == 'destroy'
            return I18n.t('audit.delete') #'delete'
          end

          if @message == 'update'
            @message = I18n.t('audit.update')
          end

          mods = @version.modified.to_a.map do |c|

            puts "#{c[0]} #{c[1]}"

            c[0] = Object.const_get(table).human_attribute_name(c[0])


            if c[1].class.name == "Moped::BSON::Binary" || c[1].class == "BSON::Binary"
              c[0] + " #{I18n.t('audit.became')} {binary data}"
            #elsif c[1].to_s.length > 220
            #  c[0] + " = " + c[1].to_s[0..200]
            elsif c[1].to_s.strip.length == 0<commit_msg>Added array<commit_after>module RailsAdmin
  module Extensions
    module MongoidAudit
      class VersionProxy
        def initialize(version)
          @version = version
        end

        def message
          @message = @version.action
          if @message == 'create'
            return I18n.t('audit.create') #'new'
          end
          if @message == 'destroy'
            return I18n.t('audit.delete') #'delete'
          end

          if @message == 'update'
            @message = I18n.t('audit.update')
          end

          mods = @version.modified.to_a.map do |c|

            puts "#{c[0]} #{c[1]}"

            c[0] = Object.const_get(table).human_attribute_name(c[0])


            if c[1].class.name == "Moped::BSON::Binary" || c[1].class == "BSON::Binary"
              c[0] + " #{I18n.t('audit.became')} {binary data}"
            #elsif c[1].to_s.length > 220
            #  c[0] + " = " + c[1].to_s[0..200]
            elsif c[1].class == Array
              c[0] + " #{I18n.t('audit.became')} #{c[1].length}"
            elsif c[1].to_s.strip.length == 0
{'fraction_non_alphanumeric': 0.155812831644959, 'fraction_numerical': 0.028461167390255667, 'mean_word_length': 1.6970091027308192, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1057398', 'n_tokens_mistral': 721, 'n_tokens_neox': 685, 'n_words': 132}