Sha256: b32ee8eac02d6ab689b1ab65368a94617a58d7d12230464343f05b5f09edd50d

Contents?: true

Size: 594 Bytes

Versions: 6

Compression:

Stored size: 594 Bytes

Contents

module Highrise
  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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rogerio-augusto-highrise-2.0.4 lib/highrise/subject.rb
rogerio-augusto-highrise-2.0.3 lib/highrise/subject.rb
rogerio-augusto-highrise-2.0.2 lib/highrise/subject.rb
highrise-2.0.1 lib/highrise/subject.rb
highrise-2.0.0 lib/highrise/subject.rb
highrise-1.2.0 lib/highrise/subject.rb