refactoring

This commit is contained in:
gitlabhq 2011-10-20 22:00:00 +03:00
parent 48924dfeea
commit c463eeb090
7 changed files with 66 additions and 37 deletions

View file

@ -1,4 +1,6 @@
class Snippet < ActiveRecord::Base
include Utils::Colorize
belongs_to :project
belongs_to :author, :class_name => "User"
has_many :notes, :as => :noteable
@ -28,6 +30,11 @@ class Snippet < ActiveRecord::Base
".js", ".sh", ".coffee", ".yml", ".md"
]
end
def colorize
ft = handle_file_type(file_name)
Albino.colorize(content, ft, :html, 'utf-8', "linenos=True")
end
end
# == Schema Information
#