refactoring
This commit is contained in:
parent
48924dfeea
commit
c463eeb090
7 changed files with 66 additions and 37 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue