Browse files

Add resource_type argument for uploading with url

  • Loading branch information...
1 parent 93cb32a commit c9d98bd320ca96aa4fd710e2f8b1da212c246a46 @jerome committed Jan 2, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/attachinary/orm/base_extension.rb
View
4 lib/attachinary/orm/base_extension.rb
@@ -44,15 +44,15 @@ def attachinary(options)
# ...
# end
define_method :"#{options[:scope]}_url=" do |url|
- send(:"#{options[:scope]}=", Cloudinary::Uploader.upload(url))
+ send(:"#{options[:scope]}=", Cloudinary::Uploader.upload(url, resource_type: "auto"))
end
else
# def image_urls=(urls)
# ...
# end
define_method :"#{options[:singular]}_urls=" do |urls|
- send(:"#{options[:scope]}=", urls.map { |url| Cloudinary::Uploader.upload(url) })
+ send(:"#{options[:scope]}=", urls.map { |url| Cloudinary::Uploader.upload(url, resource_type: "auto") })
end
end

0 comments on commit c9d98bd

Please sign in to comment.