• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / pdc_describe / e2b7cc8f-6e85-4359-a4fd-10005487ea11

pending completion
e2b7cc8f-6e85-4359-a4fd-10005487ea11

Pull #1060

circleci

Carolyn Cole
Removing UploadSnapshotController
Pull Request #1060: Integrating Support for Upload Snapshots

89 of 89 new or added lines in 6 files covered. (100.0%)

1955 of 2196 relevant lines covered (89.03%)

164.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/app/models/upload_snapshot.rb
1
# frozen_string_literal: true
2
class UploadSnapshot < ApplicationRecord
1✔
3
  belongs_to :work
1✔
4
  attr_writer :upload
1✔
5

6
  before_create do
1✔
7
    persisted = UploadSnapshot.where(filename: filename, url: url, work: work)
48✔
8

9
    next_version = if persisted.empty?
48✔
10
                     1
46✔
11
                   else
12
                     persisted.last.version + 1
2✔
13
                   end
14
    self.version = next_version
48✔
15
  end
16

17
  def upload
1✔
18
    @upload ||= uploads.find { |s3_file| s3_file.filename == filename }
6✔
19
  end
20

21
  def uri
1✔
22
    URI.parse(url)
1✔
23
  end
24

25
  def key
1✔
26
    "#{filename}-#{version}"
×
27
  end
28

29
  private
1✔
30

31
    def uploads
1✔
32
      work.uploads
2✔
33
    end
34
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc