Schema Information

Table name: snippets

id         :integer          not null, primary key
title      :string(255)
content    :text
author_id  :integer          not null
project_id :integer          not null
created_at :datetime         not null
updated_at :datetime         not null
file_name  :string(255)
expires_at :datetime
Methods
C
D
E
M
N
S
Included Modules
Class Public methods
content_types()
# File app/models/snippet.rb, line 38
def self.content_types
  [
    ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
    ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
    ".js", ".sh", ".coffee", ".yml", ".md"
  ]
end
Instance Public methods
data()
# File app/models/snippet.rb, line 46
def data
  content
end
expired?()
# File app/models/snippet.rb, line 62
def expired?
  expires_at && expires_at < Time.current
end
mode()
# File app/models/snippet.rb, line 58
def mode
  nil
end
name()
# File app/models/snippet.rb, line 54
def name
  file_name
end
size()
# File app/models/snippet.rb, line 50
def size
  0
end