fix failing tests and small refactorings

This commit is contained in:
Reinier Balt 2012-07-18 11:42:26 +02:00
parent e8c3ba2e28
commit 4e29bf69f7
8 changed files with 53 additions and 376 deletions

View file

@ -118,6 +118,9 @@ class Project < ActiveRecord::Base
return self.todos.deferred_or_blocked.empty? && self.todos.not_deferred_or_blocked.empty?
end
def shortened_name(length=40)
name.truncate(length, :omission => "...").html_safe
end
def name=(value)
self[:name] = value.gsub(/\s{2,}/, " ").strip