diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-03-24 19:26:49 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-03-24 19:26:49 +0400 |
commit | bc7c5f87bbd5cc25a0aaf03e9e5ecf6a65375098 (patch) | |
tree | b88052b6ad67a099a97d8745e9c455157f0956a9 /app/models/snippet.rb | |
parent | 7d2fbe6bd880b001857a373500e4fae31d43060a (diff) | |
download | gitlab-ce-bc7c5f87bbd5cc25a0aaf03e9e5ecf6a65375098.tar.gz |
Project snippet moved to separate model
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 5 |
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 |