Add field sort to the dossiers table
This commit is contained in:
parent
88ad986143
commit
3df9356021
11 changed files with 156 additions and 25 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -6,4 +6,8 @@ class ProcedurePresentation < ActiveRecord::Base
|
|||
field = JSON.parse(field)
|
||||
end
|
||||
end
|
||||
|
||||
def sort
|
||||
JSON.parse(read_attribute(:sort))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue