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

pulibrary / pdc_describe / 875f4cc3-d3f5-4f9c-a8d6-3139720f9a49

pending completion
875f4cc3-d3f5-4f9c-a8d6-3139720f9a49

Pull #1028

circleci

jrgriffiniii
wip
Pull Request #1028: Implementing the UploadSnapshotsController

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

1913 of 1951 relevant lines covered (98.05%)

173.23 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)
9✔
9

10
    next_version = if persisted.empty?
9✔
11
                     1
6✔
12
                   else
13
                     persisted.last.version + 1
3✔
14
                   end
15
    self.version = next_version
9✔
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