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

uclibs / ucrate / b55db03c-843f-45a9-98b3-f75772ac783c

16 Apr 2025 05:43PM UTC coverage: 54.567% (-19.5%) from 74.06%
b55db03c-843f-45a9-98b3-f75772ac783c

push

circleci

web-flow
Add github workflow to trigger Teams webhook to notify for PR (#1179)

2103 of 3854 relevant lines covered (54.57%)

42.87 hits per line

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

63.16
/app/models/classify_concern.rb
1
# frozen_string_literal: true
2
# require 'active_attr'
3
class ClassifyConcern
1✔
4
  include ActiveAttr::Model
1✔
5
  attribute :curation_concern_type
1✔
6

7
  validates(
1✔
8
    :curation_concern_type,
9
    presence: true,
10
    inclusion: { in: ->(record) { record.registered_curation_concern_types } }
×
11
  )
12

13
  def all_curation_concern_classes
1✔
14
    registered_curation_concern_types.sort.map { |c| self.class.to_class(c) }
45✔
15
  end
16

17
  def registered_curation_concern_types
1✔
18
    Hyrax.config.registered_curation_concern_types
5✔
19
  end
20

21
  def possible_curation_concern_types
1✔
22
    registered_curation_concern_types.collect do |concern|
×
23
      [self.class.to_class(concern).human_readable_type, concern]
×
24
    end
25
  end
26

27
  def curation_concern_class
1✔
28
    if possible_curation_concern_types.detect do |_name, class_name|
×
29
      class_name == curation_concern_type
×
30
    end
31
      self.class.to_class(curation_concern_type)
×
32
    else
33
      raise 'Invalid :curation_concern_type'
×
34
    end
35
  end
36

37
  # @option [String] type name of the model
38
  # @return [Class] the model class
39
  def self.to_class(type)
1✔
40
    # TODO: we may want to allow a different (or nil) namespace
41
    type.camelize.constantize
40✔
42
    # begin
43
    #   "::#{type.camelize}".constantize
44
    # rescue NameError
45
    #   "CurationConcerns::#{type}".constantize
46
    # end
47
  end
48
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

© 2026 Coveralls, Inc