aboutsummaryrefslogblamecommitdiffstats
path: root/activestorage/app/controllers/concerns/active_storage/set_blob.rb
blob: f072954d7870c7ed6d43e5e6977e8ef763a6584a (plain) (tree)
1
2
3

                             
                                      












                                                                                            
# frozen_string_literal: true

module ActiveStorage::SetBlob #:nodoc:
  extend ActiveSupport::Concern

  included do
    before_action :set_blob
  end

  private
    def set_blob
      @blob = ActiveStorage::Blob.find_signed(params[:signed_blob_id] || params[:signed_id])
    rescue ActiveSupport::MessageVerifier::InvalidSignature
      head :not_found
    end
end