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

pulibrary / pdc_describe / 599eeb90-6ff1-4336-9df7-f77411624ed7

pending completion
599eeb90-6ff1-4336-9df7-f77411624ed7

Pull #1028

circleci

jrgriffiniii
wip
Pull Request #1028: Implementing the UploadSnapshotsController

70 of 70 new or added lines in 5 files covered. (100.0%)

1910 of 1951 relevant lines covered (97.9%)

173.48 hits per line

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

82.35
/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
  has_one_attached :bitstream
1✔
6

7
  before_create do
1✔
8
    persisted = UploadSnapshot.where(key: key, url: url, work: work)
10✔
9

10
    next_version = if persisted.empty?
10✔
11
                     1
7✔
12
                   else
13
                     persisted.last.version + 1
3✔
14
                   end
15
    self.version = next_version
10✔
16
  end
17

18
  def upload
1✔
19
    @upload ||= uploads.find { |s3_file| key.include?(s3_file.key) }
×
20
  end
21

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

26
  private
1✔
27

28
    def uploads
1✔
29
      work.uploads
×
30
    end
31
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