class LogFileUploader < CarrierWave::Uploader::Base
  storage :file

  def store_dir
    'log_files/'
  end

  def cache_dir
    "#{Rails.root}/tmp/uploads"
  end
end

class LogFileUploader < CarrierWave::Uploader::Base
  storage :file

  def store_dir
    build_part_result_id = model.build_part_result_id
    build_part_id = model.build_part_result.build_part_id
    build_id = model.build_part_result.build_part.build_id
    Rails.root.join("public", "log_files", "build_#{build_id}", "build_part_#{build_part_id}", "build_part_result_#{build_part_result_id}")
  end

  def cache_dir
    Rails.root.join('tmp', 'uploads')
  end
end

Change the log file store_dir to contain the object IDs
Change the log file store_dir to contain the object IDs
