| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.
```ruby
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "benchmark-ips"
end
Benchmark.ips do |x|
x.report('+@') { +"" }
x.report('dup') { "".dup }
x.compare!
end
```
```
$ ruby -v benchmark.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Warming up --------------------------------------
+@ 282.289k i/100ms
dup 187.638k i/100ms
Calculating -------------------------------------
+@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s
dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s
Comparison:
+@: 6775299.3 i/s
dup: 3320400.7 i/s - 2.04x slower
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
attachments exist
The issue #32584 was fixed in #33405 by adding foreign key constraint
to the `active_storage_attachments` table for blobs.
This commit implements fix on app-level in order to ensure that users
can't delete a blob with attachments even if they don't have the foreign key constraint.
See a related discussion in the Campfire:
https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236718899
Note that, we should backport it to `5-2-stable` too.
Related to #33405
|
|/
|
|
|
|
|
|
|
|
|
| |
Applications can configure the route prefix prepended to the Active
Storage routes. By default this maintains the previous prefix
`/rails/active_storage` but supports custom prefixes.
Before this change the route for serving blobs is fixed to
`/rails/active_storage/blobs/:signed_id/*filename`. After this change
it's possible to configure the route to something like
`/files/blobs/:signed_id/*filename`.
|
|
|
|
|
|
|
|
|
| |
The name of the minitest library is spelled that way: regular font, and
lowercase. Lowercase is used even at the beginning of sentences, see
http://docs.seattlerb.org/minitest/
I double-checked this with @zenspider too (thanks!).
|
| |
|
|
|
|
|
|
|
|
|
| |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
|
|
|
|
|
|
| |
cbothner/azure-service-swallowing-all-errors"
This reverts commit b204d167c5cfebd59f771d406178e371811ac43a, reversing
changes made to de6a200f82a3de399fa685d583503bc88dbc5e9f.
|
|
|
|
|
|
|
|
|
| |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
|\
| |
| |
| |
| | |
cbothner/fail-gracefully-from-activestorage-file-not-found
Fail more gracefully from ActiveStorage missing file exceptions
|
| |
| |
| |
| |
| |
| | |
`ActiveStorage::DiskController#show` generates a 404 Not Found response when
the requested file is missing from the disk service. It previously raised
`Errno::ENOENT`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise
`ActiveStorage::FileNotFoundError` when the corresponding file is missing
from the storage service. Services translate service-specific missing
object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service
and `Errno::ENOENT` for the disk service) into
`ActiveStorage::FileNotFoundError`.
|
| |
| |
| |
| | |
Context https://github.com/rails/rails/pull/33413#issuecomment-414137587
|
| | |
|
| |
| |
| |
| | |
This test no longer covers the behavior of ActiveStorage::PurgeJob. Attached blobs are ignored by ActiveStorage::Blob#purge as of 934fccd, which includes an equivalent model test.
|
|/ |
|
|
|
|
| |
Provide a handy concern for custom Active Storage controllers that can't inherit from ActiveStorage::BaseController.
|
| |
|
|
|
|
|
|
| |
Closes #33292.
[Andrei Makarov & George Claghorn]
|
| |
|
| |
|
|
|
|
|
|
|
| |
Avoid mangling service names that end in S:
"GCS".classify # => "GC"
"GCS".camelize # => "GCS"
|
| |
|
|
|
|
| |
Closes #32530.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
PDFPreviewer became MuPDFPreviewer in 0b717c2. Previewers are simple enough that we can just provide a single example.
|
|
|
|
| |
&& binds tighter than || in JavaScript, but we ought not expect readers to remember language trivia.
|
|
|
|
| |
Closes #33450.
|
| |
|
|
|
| |
Do nothing instead of raising an error when it’s called on an attached blob.
|
|\
| |
| |
| |
| | |
albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails
Prefer rails command over bin/rails
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As discussed in #33203 rails command already looks for, and runs,
bin/rails if it is present.
We were mixing recommendations within guides and USAGE guidelines,
in some files we recommended using rails, in others bin/rails and
in some cases we even had both options mixed together.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Link to the corresponding ActiveStorage::Blob methods, whose docs more accurately describe their effects. [ci skip]
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
overwrite previous attachments
|
| | |
|
| | |
|