C0 code coverage information
Generated on Fri Aug 25 10:11:41 PDT 2006 with rcov 0.7.0
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 require 'auditor'
2
3 class Assignment < ActiveRecord::Base
4 include Auditor
5
6 attr_accessor :editor
7 after_create :audit_create
8 after_update :audit_update
9 after_destroy :audit_destroy
10
11 before_update :modify_timestamp
12 before_create :create_timestamp
13 before_create :set_creator
14
15 @@audit_switch = true
16
17 has_one :article
18 belongs_to :user, :foreign_key => "user_id", :class_name => "User"
19 belongs_to :creator, :foreign_key => "created_by", :class_name => "User"
20
21 #acts_as_list :scope => :assigned_to_id
22
23 MATERIALS = [
24 ["None", 0],
25 ["CD", 1],
26 ["FTP", 2],
27 ["Fulfilled", 3]
28 ]
29
30 def needs_materials?
31 unless self.needs_materials == 0
32 return true
33 else
34 return false
35 end
36 end
37
38 def materials_fulfilled?
39 unless self.materials_fulfilled == 0
40 return true
41 else
42 return false
43 end
44 end
45
46 def Assignment::audit_off
47 @@audit_switch = false
48 end
49
50 def Assignment::audit_on
51 @@audit_switch = true
52 end
53
54 def Assignment::audit_switch?
55 @@audit_switch
56 end
57
58 protected
59
60 def set_creator
61 self.created_by = editor.id
62 end
63
64 end
Generated using the rcov code coverage analysis tool for Ruby version 0.7.0.