lib/highrise/subject.rb in highrise-1.0.4 vs lib/highrise/subject.rb in highrise-1.2.0
- old
+ new
@@ -2,14 +2,24 @@
class Subject < Base
def notes
Note.find_all_across_pages(:from => "/#{self.class.collection_name}/#{id}/notes.xml")
end
+ def add_note(attrs={})
+ attrs[:subject_id] = self.id
+ attrs[:subject_type] = self.label
+ Note.create attrs
+ end
+
def emails
Email.find_all_across_pages(:from => "/#{self.class.collection_name}/#{id}/emails.xml")
end
def upcoming_tasks
Task.find(:all, :from => "/#{self.class.collection_name}/#{id}/tasks.xml")
+ end
+
+ def label
+ self.class.name.split('::').last
end
end
end
\ No newline at end of file