mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #4806 from aignatov-bio/ai-sci-7746-fix-due-date-ordering
Experiment table improve due date sorting [SCI-7746][SCI-7704]
This commit is contained in:
commit
abaf8d9e07
2 changed files with 4 additions and 4 deletions
|
@ -613,9 +613,9 @@ class ExperimentsController < ApplicationController
|
|||
def sort_my_modules(records, sort)
|
||||
case sort
|
||||
when 'due_first'
|
||||
records.order(:due_date)
|
||||
records.order(:due_date, :name)
|
||||
when 'due_last'
|
||||
records.order(Arel.sql("COALESCE(due_date, DATE '1900-01-01') DESC"))
|
||||
records.order(Arel.sql("COALESCE(due_date, DATE '2100-01-01') DESC"), :name)
|
||||
when 'atoz'
|
||||
records.order(:name)
|
||||
when 'ztoa'
|
||||
|
|
|
@ -225,9 +225,9 @@ module Experiments
|
|||
def sort_records(records)
|
||||
case @sort
|
||||
when 'due_first'
|
||||
records.order(:due_date)
|
||||
records.order(:due_date, :name)
|
||||
when 'due_last'
|
||||
records.order(Arel.sql("COALESCE(due_date, DATE '1900-01-01') DESC"))
|
||||
records.order(Arel.sql("COALESCE(due_date, DATE '2100-01-01') DESC"), :name)
|
||||
when 'atoz'
|
||||
records.order(:name)
|
||||
when 'ztoa'
|
||||
|
|
Loading…
Reference in a new issue