Skip to content

Commit

Permalink
Un-deprecate FileSystem#upload receiving unrecognized options
Browse files Browse the repository at this point in the history
In tests, people will often use FileSystem storage as a replacement for
S3 storage, and they will likely pass some S3-specific options. I think
this is a completely valid use case, and I don't see any strong reasons
for not allowing FileSystem storage to receive this options and ignore
them. So we undo the deprecation warning.
  • Loading branch information
janko committed Aug 9, 2019
1 parent d5661d5 commit 4945c45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## HEAD

* `file_system` – Un-deprecate `FileSystem#upload` receiving unrecognized options (@janko)

## 2.19.2 (2018-07-25)

* `default_url_options` – Allow deleting passed options when using a block (@janko)
Expand Down
4 changes: 1 addition & 3 deletions lib/shrine/storage/file_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def initialize(directory, prefix: nil, host: nil, clean: true, permissions: 0644
end

# Copies the file into the given location.
def upload(io, id, move: false, shrine_metadata: {}, **options)
Shrine.deprecation("Unrecognized options for FileSystem#upload: #{options.inspect}. Passing unrecognized options to FileSystem#upload will not be supported in Shrine 3.") if options.any?

def upload(io, id, move: false, **)
if move && movable?(io, id)
move(io, id)
else
Expand Down

0 comments on commit 4945c45

Please sign in to comment.