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

pulibrary / pdc_describe / 9091a1ae-29be-458c-984a-339d213919c4

12 Dec 2024 07:41PM UTC coverage: 26.434% (-69.7%) from 96.113%
9091a1ae-29be-458c-984a-339d213919c4

Pull #2000

circleci

jrgriffiniii
Removing integration with ActiveStorage
Pull Request #2000: Bump actionpack from 7.2.1.1 to 7.2.2.1

945 of 3575 relevant lines covered (26.43%)

0.35 hits per line

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

45.16
/app/decorators/work_decorator.rb
1
# frozen_string_literal: true
2
class WorkDecorator
1✔
3
  include Rails.application.routes.url_helpers
1✔
4

5
  attr_reader :work, :changes, :messages, :can_curate, :current_user
1✔
6

7
  delegate :group, :resource, :draft?, to: :work
1✔
8
  delegate :migrated, to: :resource
1✔
9

10
  def initialize(work, current_user)
1✔
11
    @work = work
×
12
    @current_user = current_user
×
13
    @changes =  WorkActivity.changes_for_work(work.id).order(created_at: :asc)
×
14
    @messages = WorkActivity.messages_for_work(work.id).order(created_at: :desc)
×
15
    @can_curate = current_user&.can_admin?(group)
×
16
  end
17

18
  def current_user_is_admin?
1✔
19
    current_user.has_role?(:group_admin, group)
×
20
  end
21

22
  def show_approve_button?
1✔
23
    work.awaiting_approval? && current_user_is_admin?
×
24
  end
25

26
  def show_revert_button?
1✔
27
    work.awaiting_approval? && (work.created_by_user_id == current_user.id || current_user_is_admin?)
×
28
  end
29

30
  def show_complete_button?
1✔
31
    draft? && (work.created_by_user_id == current_user.id || current_user_is_admin?)
×
32
  end
33

34
  def show_migrate_button?
1✔
35
    draft? && migrated && current_user_is_admin?
×
36
  end
37

38
  def edit_path
1✔
39
    if draft? && !migrated # wizard mode
×
40
      edit_work_wizard_path(work)
×
41
    else
42
      edit_work_path(work)
×
43
    end
44
  end
45

46
  def file_list_path
1✔
47
    return work_file_list_path("NONE") if @work.nil? || !@work.persisted?
×
48

49
    work_file_list_path(@work.id)
×
50
  end
51

52
  def download_path
1✔
53
    return if @work.nil? || !@work.persisted?
×
54

55
    work_download_path(@work.id)
×
56
  end
57
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