Skip to content
Snippets Groups Projects
Commit fa9c676c authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

create scopes for selecting LOs by created less than a week and a month ago

parent cd9210c8
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,8 @@ class LearningObject < ActiveRecord::Base ...@@ -55,6 +55,8 @@ class LearningObject < ActiveRecord::Base
default_scope { includes(:object_type, :attachment, :attachments).order(score: :desc) } default_scope { includes(:object_type, :attachment, :attachments).order(score: :desc) }
scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) } 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 searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type], callbacks: :async
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment