<commit_before>class Album < ActiveRecord::Base
  has_many :photos
  belongs_to :event

  def unzip_and_bind_photos
    directory = Rails.root.join('public', self.id.to_s)
    system("mkdir #{directory}")
    system("unzip #{self.zip_path} -d #{directory}")
    Dir.glob("#{directory}/*.{jpeg,png,jpg}").each do |img_path|
    end
  end
end
<commit_msg>[add] albumにphotoを紐付ける<commit_after>class Album < ActiveRecord::Base
  has_many :photos
  belongs_to :event

  def unzip_and_bind_photos
    directory = Rails.root.join('public', self.id.to_s)
    system("mkdir #{directory}")
    system("unzip #{self.zip_path} -d #{directory}")
    Dir.glob("#{directory}/*.{jpeg,png,jpg}").sort.each_with_index do |img_path, count|
      Photo.create(album_id: self.id, img_path: img_path, page: count + 1)
    end
  end
end

{'fraction_non_alphanumeric': 0.15252152521525214, 'fraction_numerical': 0.0012300123001230013, 'mean_word_length': 4.426666666666667, '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': '3262466', 'n_tokens_mistral': 304, 'n_tokens_neox': 295, 'n_words': 57}