Skip to content

Commit

Permalink
Merge pull request #5537 from avalonmediasystem/missing_proxy_methods
Browse files Browse the repository at this point in the history
Add implementation of permalink_with_query
  • Loading branch information
cjcolvar authored Dec 20, 2023
2 parents 6563b68 + bf1a020 commit 4040e7e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/presenters/speedy_af/proxy/master_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,12 @@ def supplemental_files(tag: '*')
def captions
load_subresource_content(:captions) rescue nil
end

def permalink_with_query(query_vars = {})
val = permalink
if val && query_vars.present?
val = "#{val}?#{query_vars.to_query}"
end
val ? val.to_s : nil
end
end
8 changes: 8 additions & 0 deletions app/presenters/speedy_af/proxy/media_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def sections_with_files(tag: '*')
master_files.select { |master_file| master_file.supplemental_files(tag: tag).present? }
end

def permalink_with_query(query_vars = {})
val = permalink
if val && query_vars.present?
val = "#{val}?#{query_vars.to_query}"
end
val ? val.to_s : nil
end

protected

# Overrides from SpeedyAF::Base
Expand Down

0 comments on commit 4040e7e

Please sign in to comment.