Skip to content

Commit

Permalink
πŸ’„ rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed Oct 14, 2024
1 parent e2246ca commit 3856baa
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions app/indexers/sorted_date_indexer.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
# frozen_string_literal: true

##
# A mixin for all additional Hyku applicable indexing; both Valkyrie and ActiveFedora friendly.
# A mixin for all additional Hyku applicable indexing for Valkyrie resources.
module SortedDateIndexer
# TODO: Once we've fully moved to Valkyrie, remove the generate_solr_document and move `#to_solr`
# to a more conventional method def (e.g. `def to_solr`). However, we need to tap into two
# different inheritance paths based on ActiveFedora or Valkyrie
[:generate_solr_document, :to_solr].each do |method_name|
[:to_solr].each do |method_name|
define_method method_name do |*args, **kwargs, &block|
super(*args, **kwargs, &block).tap do |index_document|
# rubocop:disable Style/ClassCheck

# Active Fedora refers to object
# Specs refer to object as @object
# Valkyrie refers to resource
object ||= @object || resource
if resource.date_created.present?
# rubocop:disable Layout/LineLength
date_created = resource.date_created.is_a?(ActiveTriples::Relation) ? resource.date_created.first : resource.date_created
Expand Down Expand Up @@ -54,7 +45,6 @@ module SortedDateIndexer
index_document['sorted_year_isi'] = formatted_date.slice(0..3).to_i
end
end

end
end
end
Expand Down

0 comments on commit 3856baa

Please sign in to comment.