Permalink
Browse files

Couldn't leave this alone ;)

  • Loading branch information...
1 parent 354489f commit e6944fea33a71d799a4360f955be36285c853ccf @jnicklas jnicklas committed Mar 10, 2011
Showing with 3 additions and 6 deletions.
  1. +2 −6 lib/carrierwave/uploader/url.rb
  2. +1 −0 spec/uploader/url_spec.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
@@ -1,6 +1,7 @@
# encoding: utf-8
require 'spec_helper'
+require 'active_support/json'
describe CarrierWave::Uploader do

0 comments on commit e6944fe

Please sign in to comment.