Skip to content
Snippets Groups Projects
Commit 6365ad59 authored by Stan Hu's avatar Stan Hu
Browse files

Remove default scope in Sortable

parent bcc504d3
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -6,10 +6,6 @@ module Sortable
extend ActiveSupport::Concern
 
included do
# By default all models should be ordered
# by created_at field starting from newest
default_scope { order_id_desc }
scope :order_id_desc, -> { reorder(id: :desc) }
scope :order_id_asc, -> { reorder(id: :asc) }
scope :order_created_desc, -> { reorder(created_at: :desc) }
Loading
Loading
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