summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorAndrew8xx8 <avk@8xx8.ru>2013-03-24 19:26:49 +0400
committerAndrew8xx8 <avk@8xx8.ru>2013-03-24 19:26:49 +0400
commitbc7c5f87bbd5cc25a0aaf03e9e5ecf6a65375098 (patch)
treeb88052b6ad67a099a97d8745e9c455157f0956a9 /app/models/snippet.rb
parent7d2fbe6bd880b001857a373500e4fae31d43060a (diff)
downloadgitlab-ce-bc7c5f87bbd5cc25a0aaf03e9e5ecf6a65375098.tar.gz
Project snippet moved to separate model
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index c4ee35e0556..592dfdfbb57 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -11,21 +11,20 @@
# updated_at :datetime not null
# file_name :string(255)
# expires_at :datetime
-#
+# type :string(255)
+# private :boolean
class Snippet < ActiveRecord::Base
include Linguist::BlobHelper
attr_accessible :title, :content, :file_name, :expires_at
- belongs_to :project
belongs_to :author, class_name: "User"
has_many :notes, as: :noteable, dependent: :destroy
delegate :name, :email, to: :author, prefix: true, allow_nil: true
validates :author, presence: true
- validates :project, presence: true
validates :title, presence: true, length: { within: 0..255 }
validates :file_name, presence: true, length: { within: 0..255 }
validates :content, presence: true