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

Make Rubocop happier about ActiveStorage

Running `rubocop activestorage` before this commit resulted in 20 offenses.
This commit only fixes:

- Trailing whitespace detected
- Space inside } missing
- Put one space between the method name and the first argument.

The other offenses are left since they are intentional according to
@georgeclaghorn (https://github.com/rails/rails/pull/30061#issuecomment-319999190)
This commit is contained in:
claudiob 2017-08-03 11:41:23 -07:00
parent 6b40fed4e2
commit 9d636c9e2f
5 changed files with 5 additions and 5 deletions

View file

@ -27,4 +27,4 @@ Gem::Specification.new do |s|
s.add_dependency "actionpack", version
s.add_dependency "activerecord", version
end
end

View file

@ -1,7 +1,7 @@
require "active_storage/blob"
require "active_support/core_ext/module/delegation"
# Attachments associate records with blobs. Usually that's a one record-many blobs relationship,
# Attachments associate records with blobs. Usually that's a one record-many blobs relationship,
# but it is possible to associate many different records with the same blob. If you're doing that,
# you'll want to declare with `has_one/many_attached :thingy, dependent: false`, so that destroying
# any one record won't destroy the blob as well. (Then you'll need to do your own garbage collecting, though).

View file

@ -1,6 +1,6 @@
require "active_support/core_ext/object/inclusion"
# A set of transformations that can be applied to a blob to create a variant. This class is exposed via
# A set of transformations that can be applied to a blob to create a variant. This class is exposed via
# the `ActiveStorage::Blob#variant` method and should rarely be used directly.
#
# In case you do need to use this directly, it's instantiated using a hash of transformations where

View file

@ -9,7 +9,7 @@ Rails.application.routes.draw do
resolve("ActiveStorage::Attachment") { |attachment| route_for(:rails_blob, attachment.blob) }
get "/rails/active_storage/variants/:signed_blob_id/:variation_key/*filename" => "active_storage/variants#show", as: :rails_blob_variation
get "/rails/active_storage/variants/:signed_blob_id/:variation_key/*filename" => "active_storage/variants#show", as: :rails_blob_variation
direct :rails_variant do |variant|
signed_blob_id = variant.blob.signed_id

View file

@ -35,7 +35,7 @@ if SERVICE_CONFIGURATIONS[:s3] && SERVICE_CONFIGURATIONS[:s3][:access_key_id].pr
end
test "uploading with server-side encryption" do
config = SERVICE_CONFIGURATIONS.deep_merge(s3: { upload: { server_side_encryption: "AES256" }})
config = SERVICE_CONFIGURATIONS.deep_merge(s3: { upload: { server_side_encryption: "AES256" } })
service = ActiveStorage::Service.configure(:s3, config)
begin