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

pulibrary / tigerdata-app / 3d88d2e1-809d-4b21-a053-6167ddb1e670

06 Nov 2025 03:55PM UTC coverage: 91.201% (+10.5%) from 80.673%
3d88d2e1-809d-4b21-a053-6167ddb1e670

push

circleci

web-flow
Fixed link, replaced image, added a test (#2158)

Closes #2156 and #2141

2840 of 3114 relevant lines covered (91.2%)

1092.36 hits per line

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

92.86
/app/presenters/project_dashboard_presenter.rb
1
# frozen_string_literal: true
2
class ProjectDashboardPresenter < ProjectShowPresenter
4✔
3
  include ActionView::Helpers::DateHelper
4✔
4

5
  delegate :to_model, :updated_at, to: :project
4✔
6

7
  def type
4✔
8
    if storage_performance_expectations["approved"].nil?
320✔
9
      "Requested #{storage_performance_expectations['requested']}"
2✔
10
    else
11
      storage_performance_expectations["approved"]
318✔
12
    end
13
  end
14

15
  def latest_file_list_time
4✔
16
    requests = FileInventoryRequest.where(project_id: project.id).order(completion_time: :desc)
322✔
17
    if requests.empty?
322✔
18
      "No Downloads"
314✔
19
    elsif requests.first.completion_time
8✔
20
      "Prepared #{time_ago_in_words(requests.first.completion_time)} ago"
6✔
21
    else
22
      "Preparing now"
2✔
23
    end
24
  end
25

26
  def last_activity
4✔
27
    if project_metadata.updated_on.nil?
316✔
28
      "Not yet active"
316✔
29
    else
30
      "#{remove_about time_ago_in_words(project_metadata.updated_on)} ago"
×
31
    end
32
  end
33

34
  def role(user)
4✔
35
    if data_sponsor.uid == user.uid
322✔
36
      "Sponsor"
166✔
37
    elsif data_manager.uid == user.uid
156✔
38
      "Data Manager"
78✔
39
    else
40
      "Data User"
78✔
41
    end
42
  end
43

44
  def path
4✔
45
    project_directory
158✔
46
  end
47

48
  # Removes "about" (as in "about 1 month ago") from time_ago_in_words
49
  def remove_about(time_ago)
4✔
50
    time_ago.gsub("about ", "")
×
51
  end
52
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