diff options
author | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-13 10:31:06 +0100 |
---|---|---|
committer | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-13 10:31:06 +0100 |
commit | 375caeefcfb2672c8fdce18cf6f35372729d0c43 (patch) | |
tree | 74b90868c88f9641a0975271f8a5620709f90eb9 /app/models/snippet.rb | |
parent | ae40e855efc393d752f290ed8eda67961874acf5 (diff) | |
parent | b9f8b4019073fe60515bda8947d9040b4b73ea38 (diff) | |
download | gitlab-ce-375caeefcfb2672c8fdce18cf6f35372729d0c43.tar.gz |
Merge branch 'master' into fixes/api
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 806d346cf10..c4ee35e0556 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -31,9 +31,9 @@ class Snippet < ActiveRecord::Base validates :content, presence: true # Scopes - scope :fresh, order("created_at DESC") - scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) - scope :expired, where(["expires_at IS NOT NULL AND expires_at < ?", Time.current]) + scope :fresh, -> { order("created_at DESC") } + scope :non_expired, -> { where(["expires_at IS NULL OR expires_at > ?", Time.current]) } + scope :expired, -> { where(["expires_at IS NOT NULL AND expires_at < ?", Time.current]) } def self.content_types [ |