Skip to content

Commit

Permalink
improve shrine resource_url method
Browse files Browse the repository at this point in the history
  • Loading branch information
akhsunna committed Jul 8, 2020
1 parent 45c3b2c commit 3dbbe93
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/rails_admin/config/fields/types/shrine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ class Shrine < RailsAdmin::Config::Fields::Types::FileUpload
def resource_url(thumb = nil)
return nil unless value

if thumb
bindings[:object].public_send(:"#{name}", thumb).url
else
value.url
end
thumb && bindings[:object].public_send(:"#{name}", thumb).try(:url) || value.url
end
end
end
Expand Down

0 comments on commit 3dbbe93

Please sign in to comment.