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

pulibrary / allsearch_api / 5a396437-9686-455f-bc17-ac568b0d1e8f

01 Dec 2025 06:12PM UTC coverage: 99.903%. Remained the same
5a396437-9686-455f-bc17-ac568b0d1e8f

Pull #410

circleci

sandbergja
Update rubocop, run automated fixes
Pull Request #410: Update rubocop, run automated fixes

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/library_database_record.rb
1
# frozen_string_literal: true
2

3
LIBRARY_DATABASE_CSV_FIELDS = [:libguides_id, :name, :description, :alt_names_concat, :url,
3✔
4
                               :friendly_url, :subjects_concat].freeze
5

6
class LibraryDatabaseRecord < ApplicationRecord
3✔
7
  scope :query, lambda { |search_term|
3✔
8
                  where(
46✔
9
                    Arel.sql("searchable @@ websearch_to_tsquery('unaccented_dict', unaccent(?))",
10
                             search_term)
11
                  ).order(
12
                    Arel.sql("ts_rank(searchable, websearch_to_tsquery('unaccented_dict', unaccent(?)))",
13
                             search_term).desc
14
                  )
15
                }
16

17
  # :reek:TooManyStatements
18
  def self.new_from_csv(row)
3✔
19
    record = LibraryDatabaseRecord.new
379✔
20
    LIBRARY_DATABASE_CSV_FIELDS.each_with_index { |field, index| record.method(:"#{field}=").call(row[index]) }
3,032✔
21
    record.alt_names = record.alt_names_concat&.split('; ')
379✔
22
    record.subjects = record.subjects_concat&.split(';')
379✔
23
    record.save
379✔
24
    record
379✔
25
  end
26
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