LafayetteCollegeLibraries/spot

View on GitHub
app/models/rdf_label.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true
#
# An ActiveRecord class to store RDF URIs and their preferred labels
# to save ourselves the hassle of fetching labels every index.
class RdfLabel < ApplicationRecord
  def self.destroy_by(**find_args)
    find_by(**find_args)&.destroy
  end

  def self.label_for(uri:)
    find_by(uri: uri)&.value
  end
end