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

pulibrary / tigerdata-app / 95ab0389-7cc4-47cf-9410-324926d2d0be

27 Oct 2025 03:10PM UTC coverage: 91.33% (+0.04%) from 91.291%
95ab0389-7cc4-47cf-9410-324926d2d0be

Pull #2057

circleci

hectorcorrea
Minor tweak
Pull Request #2057: Dashboard displays projects straights from Mediaflux

31 of 93 new or added lines in 4 files covered. (33.33%)

830 existing lines in 34 files now uncovered.

2802 of 3068 relevant lines covered (91.33%)

471.92 hits per line

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

100.0
/app/presenters/dashboard_presenter.rb
1
# frozen_string_literal: true
2
class DashboardPresenter
4✔
3
  attr_reader :current_user
4✔
4
  def initialize(current_user:)
4✔
5
    @current_user = current_user
77✔
6
  end
7

8
  def all_projects
4✔
9
    # Short-cut to prevent an extra call to Mediaflux for non-admins
10
    # which are the large majority of our users.
UNCOV
11
    return [] unless current_user&.eligible_sysadmin?
7✔
12

NEW
13
    @all_projects ||= Project.all_projects(current_user)
6✔
NEW
14
                             .map { |project| ProjectDashboardPresenter.new(project) }
115✔
NEW
15
                             .select(&:project_in_rails?)
NEW
16
                             .sort_by(&:updated_at)
NEW
17
                             .reverse
18
    @all_projects
6✔
19
  end
20

21
  def dashboard_projects
4✔
NEW
22
    @dashboard_projects ||= Project.users_projects(current_user)
66✔
NEW
23
                                   .map { |project| ProjectDashboardPresenter.new(project) }
1,123✔
NEW
24
                                   .select(&:project_in_rails?)
NEW
25
                                   .sort_by(&:updated_at)
NEW
26
                                   .reverse
27
    @dashboard_projects
66✔
28
  end
29

30
  def my_inventory_requests
4✔
31
    @my_inventory_requests ||= current_user.user_requests.where(type: "FileInventoryRequest")
2✔
32
  end
33

34
  def my_draft_requests
4✔
35
    @my_draft_requests ||= Request.where(requested_by: current_user.uid, state: Request::DRAFT)
66✔
36
  end
37

38
  def my_submitted_requests
4✔
39
    @my_submitted_requests ||= Request.where(requested_by: current_user.uid, state: Request::SUBMITTED)
66✔
40
  end
41
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