lib/pivotal-tracker/story.rb in pivotal-tracker-0.1.3 vs lib/pivotal-tracker/story.rb in pivotal-tracker-0.2.0
- old
+ new
@@ -37,20 +37,26 @@
end
def create
return self if project_id.nil?
response = Client.connection["/projects/#{project_id}/stories"].post(self.to_xml, :content_type => 'application/xml')
- return Story.parse(response)
+ new_story = Story.parse(response)
+ new_story.project_id = project_id
+ return new_story
end
def update(attrs={})
update_attributes(attrs)
response = Client.connection["/projects/#{project_id}/stories/#{id}"].put(self.to_xml, :content_type => 'application/xml')
return Story.parse(response)
end
def delete
Client.connection["/projects/#{project_id}/stories/#{id}"].delete
+ end
+
+ def notes
+ @notes ||= Proxy.new(self, Note)
end
def tasks
@tasks ||= Proxy.new(self, Task)
end