| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| app/models/note.rb | 26 | 21 | 100.00%
|
100.00%
|
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 class Note < ActiveRecord::Base |
2 belongs_to :user, :foreign_key => :creator_id, :counter_cache => true |
3 belongs_to :noteable, :polymorphic => true, :counter_cache => true |
4 |
5 validates_presence_of :notes_message, :creator_id, :noteable |
6 validates_associated :user |
7 |
8 NOTEABLES = ["Grouping", "Student", "Assignment"] |
9 |
10 def user_can_modify?(current_user) |
11 return current_user.admin? || user == current_user |
12 end |
13 |
14 def format_date |
15 return I18n.l(created_at, :format => :long_date) |
16 end |
17 |
18 def self.noteables_exist? |
19 NOTEABLES.each do |classname| |
20 if !(Kernel.const_get(classname).all.empty?) |
21 return true |
22 end |
23 end |
24 return false |
25 end |
26 end |
Generated on Sun Feb 05 00:08:07 -0500 2012 with rcov 0.9.10