1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

restores some double newlines deleted in ae87217

These were intentional, see

https://github.com/rails/rails/pull/30061#issuecomment-320068368
This commit is contained in:
Xavier Noria 2017-08-15 21:57:27 +02:00
parent 979277dc03
commit d8bf5d73c3
3 changed files with 6 additions and 0 deletions

View file

@ -33,6 +33,7 @@ class ActiveStorage::DiskController < ActionController::Base
ActiveStorage::Blob.service
end
def decode_verified_key
ActiveStorage.verifier.verified(params[:encoded_key], purpose: :blob_key)
end
@ -41,6 +42,7 @@ class ActiveStorage::DiskController < ActionController::Base
params[:disposition].presence_in(%w( inline attachment )) || "inline"
end
def decode_verified_token
ActiveStorage.verifier.verified(params[:encoded_token], purpose: :blob_token)
end

View file

@ -59,6 +59,7 @@ class ActiveStorage::Blob < ActiveRecord::Base
end
end
# Returns a signed ID for this blob that's suitable for reference on the client-side without fear of tampering.
# It uses the framework-wide verifier on <tt>ActiveStorage.verifier</tt>, but with a dedicated purpose.
def signed_id
@ -120,6 +121,7 @@ class ActiveStorage::Blob < ActiveRecord::Base
ActiveStorage::Variant.new(self, ActiveStorage::Variation.new(transformations))
end
# Returns the URL of the blob on the service. This URL is intended to be short-lived for security and not used directly
# with users. Instead, the +service_url+ should only be exposed as a redirect from a stable, possibly authenticated URL.
# Hiding the +service_url+ behind a redirect also gives you the power to change services without updating all URLs. And
@ -162,6 +164,7 @@ class ActiveStorage::Blob < ActiveRecord::Base
service.download key, &block
end
# Deletes the file on the service that's associated with this blob. This should only be done if the blob is going to be
# deleted as well or you will essentially have a dead reference. It's recommended to use the +#purge+ and +#purge_later+
# methods in most circumstances.

View file

@ -65,6 +65,7 @@ class ActiveStorage::Variant
service.url key, expires_in: expires_in, disposition: disposition, filename: blob.filename, content_type: blob.content_type
end
private
def processed?
service.exist?(key)