diff --git a/app/models/document.rb b/app/models/document.rb index 12db7a6d..c24f111f 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -32,7 +32,7 @@ def item_viewer # DocumentAssets def document_assets scope = Kithe::Asset - scope = scope.where(parent_id: self.id) + scope = scope.where(parent_id: id) # scope = scope.page(params[:page]).per(20).order(created_at: :desc) scope.includes(:parent) diff --git a/app/services/geoblacklight_admin/image_service/tms.rb b/app/services/geoblacklight_admin/image_service/tms.rb index d07a69ec..55db6a70 100644 --- a/app/services/geoblacklight_admin/image_service/tms.rb +++ b/app/services/geoblacklight_admin/image_service/tms.rb @@ -1,18 +1,18 @@ # frozen_string_literal: true -require 'addressable/uri' +require "addressable/uri" module GeoblacklightAdmin class ImageService module Tms ## - # Formats and returns a thumbnail url from a Web Map Service endpoint. + # Formats and returns a thumbnail url for a TMS endpoint from a Web Map Service. # This utilizes the GeoServer specific 'reflect' service to generate # parameters like bbox that are difficult to tweak without more detailed # information about the layer. # @param [SolrDocument] # @param [Integer] thumbnail size - # @return [String] wms thumbnail url + # @return [String] tms thumbnail url def self.image_url(document, size) puts "\nTMS IMAGE URL..." puts "document.viewer_endpoint: #{document.viewer_endpoint.inspect}" @@ -29,12 +29,9 @@ def self.image_url(document, size) puts "Parsed URL: #{parsed_url.inspect}" - # Extract the path from the URL - path = parsed_url.path - # Build a hash to store the extracted components parsed_data = { - base_url: "#{parsed_url.scheme}://#{parsed_url.host}#{parsed_url.port ? ':' + parsed_url.port.to_s : ''}", + base_url: "#{parsed_url.scheme}://#{parsed_url.host}#{parsed_url.port ? ":" + parsed_url.port.to_s : ""}", path_pattern: parsed_url.path } diff --git a/lib/geoblacklight_admin/rake_task.rb b/lib/geoblacklight_admin/rake_task.rb index ab6070a4..e53cd01c 100644 --- a/lib/geoblacklight_admin/rake_task.rb +++ b/lib/geoblacklight_admin/rake_task.rb @@ -2,4 +2,4 @@ module GeoblacklightAdmin module RakeTask Dir[File.expand_path(File.join(File.dirname(__FILE__), "tasks/*.rake"))].each { |ext| load ext } if defined?(Rake) end -end \ No newline at end of file +end