Skip to content

Loading…

Add an optional category_id to Attachment #13

Merged
merged 1 commit into from

2 participants

@djhopper01

I found myself needing to update the category of an attachment. This simple addition will allow you to do that in the usual style.

@anibalcucco anibalcucco merged commit b42897a into anibalcucco:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 19, 2011
  1. Adding optional category_id to Attachment.

    Derek Hopper committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/basecamp/resources/attachment.rb
View
4 lib/basecamp/resources/attachment.rb
@@ -1,5 +1,5 @@
module Basecamp; class Attachment
- attr_accessor :id, :filename, :content
+ attr_accessor :id, :filename, :content, :category_id
def self.create(filename, content)
returning new(filename, content) do |attachment|
@@ -16,7 +16,7 @@ def attributes
end
def to_xml(options = {})
- { :file => attributes }.to_xml(options)
+ { :file => attributes, :category_id => category_id }.to_xml(options)
end
def inspect
Something went wrong with that request. Please try again.