Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Couldn't leave this alone ;)

  • Loading branch information...
commit e6944fea33a71d799a4360f955be36285c853ccf 1 parent 354489f
@jnicklas jnicklas authored
Showing with 3 additions and 6 deletions.
  1. +2 −6 lib/carrierwave/uploader/url.rb
  2. +1 −0  spec/uploader/url_spec.rb
View
8 lib/carrierwave/uploader/url.rb
@@ -26,13 +26,9 @@ def url
#
def as_json(options = nil)
h = { :url => url }
- versions.each do |name, version|
- h[version.version_name] = {}
- h[version.version_name]['url'] = version.url
- end
- h
+ h.merge Hash[versions.map { |name, version| [name, { url: version.url }] }]
end
end # Url
end # Uploader
-end # CarrierWave
+end # CarrierWave
View
1  spec/uploader/url_spec.rb
@@ -1,6 +1,7 @@
# encoding: utf-8
require 'spec_helper'
+require 'active_support/json'
describe CarrierWave::Uploader do
Please sign in to comment.
Something went wrong with that request. Please try again.