Permalink
Browse files

More documentation about Todo Items

  • Loading branch information...
1 parent 964ed08 commit 1787a9b9e09212b4d301547c55d1ee309e776cb7 @anibalcucco committed Sep 24, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 README.rdoc
View
@@ -155,6 +155,24 @@ For example, to list all milestones in a project:
milestones = Basecamp::Milestone.list(1037)
milestones.first.title # => "The Milestone"
+=== More about Todo Items
+
+To access all todo items in a todo list:
+
+ Basecamp::TodoItem.find(:all, :params => { :todo_list_id => 3422 })
+
+You can't access all todo items in a project with a single API call.
+So you have to do something like this:
+
+ def todo_items_on_project(project_id)
+ todo_items = []
+ todo_lists = TodoList.find(:all, :params => { :project_id => project_id })
+ todo_lists.each do |todo_list|
+ todo_items += TodoItem.find(:all, :params => { :todo_list_id => todo_list.id })
+ end
+ todo_items
+ end
+
= Using the non-REST interface
You can access other resources not included in this wrapper yet using "record" and "records".

0 comments on commit 1787a9b

Please sign in to comment.