Skip to content

Commit

Permalink
Add file upload to Artifact API class for creation of new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lance committed Jan 19, 2011
1 parent 106081e commit 364c1cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/artifact_versions_controller.rb
Expand Up @@ -46,7 +46,7 @@ def create
respond_to do |format|
if @artifact_version.save
format.html { redirect_to(@artifact, :notice => 'Version was successfully created.') }
format.xml { render :xml => @artifact_version, :status => :created, :location => @artifact_version }
format.xml { redirect_to(artifact_url(@artifact), :status => :created) }
else
format.html { render :action => "new" }
format.xml { render :xml => @artifact_version.errors, :status => :unprocessable_entity }
Expand Down
4 changes: 2 additions & 2 deletions lib/steamcannon/api/artifact.rb
Expand Up @@ -8,8 +8,8 @@ def versions
end
end

def create_version(data)
puts "This part isn't done yet - but when it is, we'll upload #{data}"
def create_version(artifact_file)
@connector.post(@data['artifact_versions'][0]['href'], "artifact_version[archive]"=>File.new(artifact_file, "rb"))
end

protected
Expand Down

0 comments on commit 364c1cf

Please sign in to comment.