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.rb6
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
[