app/models/taxon_concept_cache_clearing.rb
# TODO - refactor and test. Not in that order. I did only the most obvious cleanup, here. And it clearly needs more.  :|
refactor and test. Not in that order. I did only the most obvious cleanup, here. And it clearly needs more.
refactor and test . Not in that order . I did only the most obvious cleanup here . And it clearly needs more .
def clear_for_data_objects(data_objects)
    data_objects.compact.each do |data_object|
      data_object = data_object.data_object if data_object.respond_to?(:data_object)
      next if data_object.nil? 
      if data_object.data_type.label == 'Image'
        clear_if_guid_matches("best_image_id_#{@taxon_concept.id}", data_object)
        @taxon_concept.published_browsable_hierarchy_entries.each do |pbhe|
          clear_if_guid_matches("best_image_id_#{@taxon_concept.id}_#{pbhe.id}", data_object)
        end
      end
    end
    clear_media_counts
  end
def clear_for_data_objects ( data_objects ) data_objects . compact . each do | data_object | data_object = data_object . data_object if data_object . respond_to? ( :data_object ) next if data_object . nil? if data_object . data_type . label == 'Image' clear_if_guid_matches ( "best_image_id_#{@taxon_concept.id}" , data_object ) @taxon_concept . published_browsable_hierarchy_entries . each do | pbhe | clear_if_guid_matches ( "best_image_id_#{@taxon_concept.id}_#{pbhe.id}" , data_object ) end end end clear_media_counts end
TODO - refactor and test.
TODO - refactor and test .
# Allows more things to be passed in, like TaxonConceptExemplarImage: # Strange to do this twice, but we have to because of the previous line. :\
data_objects
<not_specific>