Initial commit
This commit is contained in:
7
app/models/concerns/recentable.rb
Normal file
7
app/models/concerns/recentable.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module Recentable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
scope :recent, ->(number) { order("created_at DESC").limit(number) }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user