diff options
author | Jason Lee <huacnlee@gmail.com> | 2018-02-08 10:15:55 +0800 |
---|---|---|
committer | Jason Lee <huacnlee@gmail.com> | 2018-02-08 10:15:55 +0800 |
commit | 0625a2ba80476bf0139f2ecb9019dc2c82e4a7de (patch) | |
tree | c55afd7aa065c6ab062da03550932feff130793f /guides/bug_report_templates | |
parent | 01c54e29bd288bf250b6e277046594f06b211a6f (diff) | |
download | rails-0625a2ba80476bf0139f2ecb9019dc2c82e4a7de.tar.gz rails-0625a2ba80476bf0139f2ecb9019dc2c82e4a7de.tar.bz2 rails-0625a2ba80476bf0139f2ecb9019dc2c82e4a7de.zip |
Fix `blob.service_url` for supports string or nil `:filename` option.
- Make sure `blob.service_url` present a `ActiveStorage::Filename` type to `serivce.url`.
- Add `ActiveStorage::Filename.wrap` method.
before:
```rb
blob.service_url(filename: ActiveStorage::Filename.new("new.txt"))
blob.service_url(filename: "new.txt")
=> NoMethodError: undefined method `parameters' for "new.txt":String
params = {}
blob.service_url(filename: params[:filename])
=> NoMethodError: undefined method `parameters' for nil:NilClass
```
after:
```rb
blob.service_url(filename: "new.txt")
blob.service_url(filename: nil)
```
Diffstat (limited to 'guides/bug_report_templates')
0 files changed, 0 insertions, 0 deletions