summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb20
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])