Move all order logic to models
- Have a default order for each model -- The overall default is ID DESC - Allow for custom orderings -- When comma-separated IDs are used
This commit is contained in:
@@ -33,7 +33,6 @@ class ArtistCommentary < ApplicationRecord
|
||||
|
||||
def search(params)
|
||||
q = super
|
||||
params = {} if params.blank?
|
||||
|
||||
if params[:text_matches].present?
|
||||
q = q.text_matches(params[:text_matches])
|
||||
@@ -62,7 +61,7 @@ class ArtistCommentary < ApplicationRecord
|
||||
q = q.deleted if params[:is_deleted] == "yes"
|
||||
q = q.undeleted if params[:is_deleted] == "no"
|
||||
|
||||
q
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user