Permalink
Browse files

Core: Fixed the url helper to deal with number id (DTACLOUD-255)

  • Loading branch information...
1 parent 1b48f17 commit b9746d3fe70cb99fd03de3fd0e5cd470f6014da7 @mfojtik mfojtik committed Jul 9, 2012
@@ -409,7 +409,7 @@ def convert_key(password)
def convert_image(gg_image, owner_id=nil)
Image.new( {
- :id=>gg_image['id'],
+ :id=>gg_image['id'].to_s,
:name => "#{gg_image['friendlyName']}",
:description=> convert_description(gg_image).to_s,
:owner_id=>gg_image['owner']['name'].to_s,
@@ -35,9 +35,9 @@ def method_missing(name, *args)
t = $1
if t.match(/^(stop|reboot|start|attach|detach)_/)
action = $1
- api_url_for(t.pluralize.split('_').last + '/' + args.first + '/' + action, :full)
+ api_url_for(t.pluralize.split('_').last + '/' + args.first.to_s + '/' + action, :full)
elsif t.match(/^(destroy|update)_/)
- api_url_for(t.pluralize.split('_').last + '/' + args.first, :full)
+ api_url_for(t.pluralize.split('_').last + '/' + args.first.to_s, :full)
else
api_url_for(t.pluralize, :full) + '/' + "#{args.first}"
end

0 comments on commit b9746d3

Please sign in to comment.