cache columns per request using Current
This commit is contained in:
parent
249ddf291f
commit
450420aa81
2 changed files with 10 additions and 5 deletions
|
@ -10,11 +10,15 @@ module ColumnsConcern
|
|||
end
|
||||
|
||||
def columns
|
||||
columns = dossier_columns
|
||||
columns.concat(standard_columns)
|
||||
columns.concat(individual_columns) if for_individual
|
||||
columns.concat(moral_columns) if !for_individual
|
||||
columns.concat(types_de_champ_columns)
|
||||
Current.procedure_columns ||= {}
|
||||
|
||||
Current.procedure_columns[id] ||= begin
|
||||
columns = dossier_columns
|
||||
columns.concat(standard_columns)
|
||||
columns.concat(individual_columns) if for_individual
|
||||
columns.concat(moral_columns) if !for_individual
|
||||
columns.concat(types_de_champ_columns)
|
||||
end
|
||||
end
|
||||
|
||||
def dossier_id_column
|
||||
|
|
|
@ -9,4 +9,5 @@ class Current < ActiveSupport::CurrentAttributes
|
|||
attribute :no_reply_email
|
||||
attribute :request_id
|
||||
attribute :user
|
||||
attribute :procedure_columns
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue