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

pulibrary / pdc_describe / 4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

07 Apr 2025 06:36PM UTC coverage: 1.283% (-94.6%) from 95.862%
4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

Pull #1994

circleci

hectorcorrea
Switched to use the autocomplete that we aleady use for ROR. Integrated it with the existing logic for creators
Pull Request #1994: Started adding auto complete to contributors

0 of 46 new or added lines in 2 files covered. (0.0%)

4806 existing lines in 74 files now uncovered.

65 of 5065 relevant lines covered (1.28%)

0.01 hits per line

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

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

UNCOV
5
  attr_reader :work, :changes, :messages, :can_curate, :current_user
×
6

UNCOV
7
  delegate :group, :resource, :draft?, to: :work
×
UNCOV
8
  delegate :migrated, to: :resource
×
9

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

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

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

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

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

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

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

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

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

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

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