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

pulibrary / allsearch_api / 8cca27ea-0ec0-4546-b1e5-0dc9f1ef05a3

31 Oct 2025 06:27PM UTC coverage: 99.903% (+0.003%) from 99.9%
8cca27ea-0ec0-4546-b1e5-0dc9f1ef05a3

Pull #389

circleci

sandbergja
Replace uses of the Banner ActiveRecord model with Rom-RB

The ActiveRecord model is still used in tests and a database migration,
maybe those could be migrated to Rom-RB in a separate PR?

A Rom Container is created that uses the same database connections as
ActiveRecord.  This allows rom to use the same database transactions
as activerecord, allowing tests (which use db transactions to stay
isolated from one another) to still pass.
Pull Request #389: Replace uses of the Banner ActiveRecord model with Rom-RB

34 of 39 new or added lines in 4 files covered. (87.18%)

57 existing lines in 13 files now uncovered.

1031 of 1032 relevant lines covered (99.9%)

112.35 hits per line

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

100.0
/app/models/article_document.rb
1
# frozen_string_literal: true
2

3
# This class is responsible for getting relevant
4
# metadata from the Summon::Documents
5
class ArticleDocument < Document
3✔
6
  delegate :abstract, to: :document
3✔
7
  delegate :end_page, to: :document
3✔
8
  delegate :issue, to: :document
3✔
9
  delegate :publication_title, to: :document
3✔
10
  delegate :publisher, to: :document
3✔
11
  delegate :start_page, to: :document
3✔
12
  delegate :volume, to: :document
3✔
13

14
  def title
3✔
UNCOV
15
    sanitize document.title
56✔
16
  end
17

18
  def creator
3✔
UNCOV
19
    document&.authors&.first&.fullname
55✔
20
  end
21

22
  def id
3✔
UNCOV
23
    document.src['DOI']&.first
55✔
24
  end
25

26
  def type
3✔
UNCOV
27
    document.content_type
56✔
28
  end
29

30
  # NOTE: the Snippet includes html to emphasize the relevant term, e.g.
31
  # In 1994, the Government of Cameroon introduced an array of <h>forest</h> policy reforms
32
  def description
3✔
UNCOV
33
    sanitize document.snippet
55✔
34
  end
35

36
  def url
3✔
UNCOV
37
    document.link
55✔
38
  end
39

40
  def doc_keys
3✔
UNCOV
41
    [:publication_date, :publication_year, :start_page, :end_page, :fulltext_available, :abstract,
54✔
42
     :publication_title, :volume, :issue, :isxn]
43
  end
44

45
  def fulltext_available
3✔
UNCOV
46
    document.fulltext ? 'Full-text available' : nil
55✔
47
  end
48

49
  def isxn
3✔
UNCOV
50
    (isbn + issn).compact.first
56✔
51
  end
52

53
  def isbn
3✔
UNCOV
54
    document.src['ISBN'].presence || []
56✔
55
  end
56

57
  def issn
3✔
UNCOV
58
    document.src['ISSN'].presence || []
56✔
59
  end
60

61
  def publication_date
3✔
UNCOV
62
    document.publication_date.text
56✔
63
  end
64

65
  def publication_year
3✔
UNCOV
66
    document.publication_date.year.to_s
56✔
67
  end
68
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