<commit_before>module AbAdmin
  module Models
    module Asset
      extend ActiveSupport::Concern

      included do
        belongs_to :user
        belongs_to :assetable, polymorphic: true

        # Store options for image manipulation
        attr_reader :cropper_geometry, :rotate_degrees

        delegate :url, to: :data

        class_attribute :thumb_size, :max_size
        self.thumb_size = :thumb
        self.max_size = 2

        before_save :reprocess

        alias_attribute :filename, :data_file_name
        alias_attribute :size, :data_file_size
        alias_attribute :content_type, :data_content_type
      end

      module ClassMethods
        def move_to(index, id)
          where(id: id.to_i).update_all(sort_order: index)
        end

        def ext_list
          return unless uploaders[:data]
          uploaders[:data].new.extension_white_list
        end

        def clean!
          where('assetable_id IS NULL OR assetable_id = 0 AND created_at < ?', 1.week.ago).destroy_all
        end
      end

      def store_model_filename(record)
        data.store_model_filename(record) and save!(validate: false)
      end

      # allow to build custom human file name
      def build_filename(base_filename, record=nil)
        nil
      end

      def thumb_url
        return unless image?
        data.versions[thumb_size] ? data.url(thumb_size) : data.url
      end
<commit_msg>Use Asset#url method in Asset#thumb_url<commit_after>module AbAdmin
  module Models
    module Asset
      extend ActiveSupport::Concern

      included do
        belongs_to :user
        belongs_to :assetable, polymorphic: true

        # Store options for image manipulation
        attr_reader :cropper_geometry, :rotate_degrees

        delegate :url, to: :data

        class_attribute :thumb_size, :max_size
        self.thumb_size = :thumb
        self.max_size = 2

        before_save :reprocess

        alias_attribute :filename, :data_file_name
        alias_attribute :size, :data_file_size
        alias_attribute :content_type, :data_content_type
      end

      module ClassMethods
        def move_to(index, id)
          where(id: id.to_i).update_all(sort_order: index)
        end

        def ext_list
          return unless uploaders[:data]
          uploaders[:data].new.extension_white_list
        end

        def clean!
          where('assetable_id IS NULL OR assetable_id = 0 AND created_at < ?', 1.week.ago).destroy_all
        end
      end

      def store_model_filename(record)
        data.store_model_filename(record) and save!(validate: false)
      end

      # allow to build custom human file name
      def build_filename(base_filename, record=nil)
        nil
      end

      def thumb_url
        return unless image?
        data.versions[thumb_size] ? url(thumb_size) : url
      end

{'fraction_non_alphanumeric': 0.06320224719101124, 'fraction_numerical': 0.002106741573033708, 'mean_word_length': 2.2860438292964242, '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': '3599654', 'n_tokens_mistral': 839, 'n_tokens_neox': 794, 'n_words': 212}