Skip to content

Commit

Permalink
Merge pull request #7 from jrochkind/guard_define_local_object_key
Browse files Browse the repository at this point in the history
Only define local Storage#object_key if Shrine isn't already providing
  • Loading branch information
jrochkind authored Dec 4, 2023
2 parents 9c1f52d + c004e6d commit 50bea40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- response-expires header format match recent AWS ruby SDK by using #httpdate https://github.com/jrochkind/faster_s3_url/pull/5

- Only define local Storage#object_key if Shrine isn't already providing https://github.com/jrochkind/faster_s3_url/pull/7

### Changed

Expand Down
2 changes: 1 addition & 1 deletion lib/faster_s3_url/shrine/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def url(id, public: self.public, **options)
end

# For older shrine versions without it, we need this...
unless self.method_defined?(:object_key)
unless self.method_defined?(:object_key) || self.private_method_defined?(:object_key)
def object_key(id)
[*prefix, id].join("/")
end
Expand Down

0 comments on commit 50bea40

Please sign in to comment.