diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:07:50 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:25:15 -0400 |
commit | 775418918782d5284000ed0bfea364458c748567 (patch) | |
tree | c31e3633a3bcbed17b000f0165cf35edad41f7ca /app/models/snippet.rb | |
parent | 1413c23c502d5a5cbc9b81f553a245103c1d6e50 (diff) | |
download | gitlab-ce-775418918782d5284000ed0bfea364458c748567.tar.gz |
Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index e5f04bb228b..2c941499f1f 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base include Linguist::BlobHelper belongs_to :project - belongs_to :author, :class_name => "User" - has_many :notes, :as => :noteable, :dependent => :destroy + belongs_to :author, class_name: "User" + has_many :notes, as: :noteable, dependent: :destroy delegate :name, :email, - :to => :author, - :prefix => true + to: :author, + prefix: true attr_protected :author, :author_id, :project, :project_id validates_presence_of :project_id validates_presence_of :author_id validates :title, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } validates :file_name, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } validates :content, - :presence => true, - :length => { :within => 0..10000 } + presence: true, + length: { within: 0..10000 } scope :fresh, order("created_at DESC") scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) |