Browse Source

add: project order index

pull/278/head
vilet.yy 5 years ago
parent
commit
9553740960
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      app/queries/projects/list_query.rb
  2. +5
    -0
      db/migrate/20210317062206_add_order_index_to_project.rb

+ 1
- 1
app/queries/projects/list_query.rb View File

@@ -15,7 +15,7 @@ class Projects::ListQuery < ApplicationQuery
scope = q
.with_project_type(params[:project_type])
.with_project_category(params[:category_id])
.with_project_language(params[:language_id])
.with_project_language(params[:language_id]).order(order_index: :desc)

sort = params[:sort_by] || "updated_on"
sort_direction = params[:sort_direction] || "desc"


+ 5
- 0
db/migrate/20210317062206_add_order_index_to_project.rb View File

@@ -0,0 +1,5 @@
class AddOrderIndexToProject < ActiveRecord::Migration[5.2]
def change
add_column :projects, :order_index, :integer, default: 0
end
end

Loading…
Cancel
Save