| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| app/models/ta.rb | 52 | 41 | 86.54%
|
82.93%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 # we need repository and permission constants |
2 require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'repo', 'repository') |
3 |
4 class Ta < User |
5 |
6 CSV_UPLOAD_ORDER = USER_TA_CSV_UPLOAD_ORDER |
7 SESSION_TIMEOUT = USER_TA_SESSION_TIMEOUT |
8 |
9 after_create :grant_repository_permissions |
10 after_destroy :revoke_repository_permissions |
11 after_update :maintain_repository_permissions |
12 |
13 has_many :criterion_ta_associations, :dependent => :delete_all |
14 |
15 def memberships_for_assignment(assignment) |
16 return assignment.ta_memberships.find_all_by_user_id(id, :include => {:grouping => :group}) |
17 end |
18 |
19 def is_assigned_to_grouping?(grouping_id) |
20 grouping = Grouping.find(grouping_id) |
21 return grouping.ta_memberships.find_all_by_user_id(id).size > 0 |
22 end |
23 |
24 def get_criterion_associations_by_assignment(assignment) |
25 if assignment.assign_graders_to_criteria |
26 return criterion_ta_associations.map do |association| |
27 if association.assignment == assignment |
28 association |
29 else |
30 nil |
31 end |
32 end.compact |
33 else |
34 return [] |
35 end |
36 end |
37 |
38 def get_criterion_associations_count_by_assignment(assignment) |
39 return assignment.criterion_ta_associations.count( |
40 :conditions => "ta_id = #{self.id}") |
41 end |
42 |
43 def get_membership_count_by_assignment(assignment) |
44 return memberships.count(:include => :grouping, |
45 :conditions => "assignment_id = #{assignment.id}") |
46 end |
47 |
48 def get_groupings_by_assignment(assignment) |
49 return groupings.all(:conditions => {:assignment_id => assignment.id}, |
50 :include => [:students, :tas, :group, :assignment]) |
51 end |
52 end |
Generated on Sun Feb 05 00:08:07 -0500 2012 with rcov 0.9.10