Add field sort to the dossiers table

This commit is contained in:
gregoirenovel 2017-09-27 15:16:07 +02:00
parent 88ad986143
commit 3df9356021
11 changed files with 156 additions and 25 deletions

View file

@ -349,6 +349,10 @@ class Dossier < ActiveRecord::Base
end
end
def self.sanitize_for_order(order)
sanitize_sql_for_order(order)
end
private
def build_attestation

View file

@ -232,6 +232,14 @@ class Procedure < ActiveRecord::Base
end
end
def self.default_sort
{
'table' => 'self',
'column' => 'id',
'order' => 'desc'
}.to_json
end
private
def field_hash(label, table, column)

View file

@ -6,4 +6,8 @@ class ProcedurePresentation < ActiveRecord::Base
field = JSON.parse(field)
end
end
def sort
JSON.parse(read_attribute(:sort))
end
end