diff --git a/app/models/learning_object.rb b/app/models/learning_object.rb index 63f5dc60e7989235c95b89a56f4be1c76e0244b6..5af6a084e9710237594105969c2f6407591fae62 100644 --- a/app/models/learning_object.rb +++ b/app/models/learning_object.rb @@ -55,6 +55,8 @@ class LearningObject < ActiveRecord::Base default_scope { includes(:object_type, :attachment, :attachments).order(score: :desc) } scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) } + scope :this_week, -> { where('created_at >= ?', 1.week.ago) } + scope :this_month, -> { where('created_at >= ?', 1.month.ago) } searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type], callbacks: :async