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

pulibrary / tigerdata-app / 0019595b-313f-4750-bd3d-0a8f81fb3788

28 Oct 2025 02:15PM UTC coverage: 91.195% (-0.1%) from 91.294%
0019595b-313f-4750-bd3d-0a8f81fb3788

Pull #2103

circleci

kelynch
Swapped order on requests index page
Pull Request #2103: Moved submitted requests to the top of the requests index page

2755 of 3021 relevant lines covered (91.19%)

374.17 hits per line

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

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

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

7
  delegate :data_sponsor, :data_manager, to: :project_metadata
3✔
8

9
  def type
3✔
10
    if storage_performance_expectations["approved"].nil?
178✔
11
      "Requested #{storage_performance_expectations['requested']}"
3✔
12
    else
13
      storage_performance_expectations["approved"]
175✔
14
    end
15
  end
16

17
  def latest_file_list_time
3✔
18
    requests = FileInventoryRequest.where(project_id: project.id).order(completion_time: :desc)
179✔
19
    if requests.empty?
179✔
20
      "No Downloads"
175✔
21
    elsif requests.first.completion_time
4✔
22
      "Prepared #{time_ago_in_words(requests.first.completion_time)} ago"
3✔
23
    else
24
      "Preparing now"
1✔
25
    end
26
  end
27

28
  def last_activity
3✔
29
    if project_metadata.updated_on.nil?
177✔
30
      "Not yet active"
4✔
31
    else
32
      "#{remove_about time_ago_in_words(project_metadata.updated_on)} ago"
173✔
33
    end
34
  end
35

36
  def role(user)
3✔
37
    if data_sponsor == user.uid
176✔
38
      "Sponsor"
50✔
39
    elsif data_manager == user.uid
126✔
40
      "Data Manager"
44✔
41
    else
42
      "Data User"
82✔
43
    end
44
  end
45

46
  def path
3✔
47
    "/#{project_metadata.project_directory}"
88✔
48
  end
49

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