Class: DataList
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- DataList
show all
- Defined in:
- app/models/rails_data/data_list.rb
Instance Method Summary
collapse
Instance Method Details
#config_excel ⇒ Object
39
40
41
|
# File 'app/models/rails_data/data_list.rb', line 39
def config_excel
@config_excel ||= export_excel.to_s.safe_constantize
end
|
#config_params ⇒ Object
29
30
31
32
33
|
# File 'app/models/rails_data/data_list.rb', line 29
def config_params
hash = {}
config_table.parameters.map { |p| hash[p] = nil }
hash
end
|
#config_pdf ⇒ Object
43
44
45
|
# File 'app/models/rails_data/data_list.rb', line 43
def config_pdf
@config_pdf ||= export_pdf.to_s.safe_constantize
end
|
#config_table ⇒ Object
35
36
37
|
# File 'app/models/rails_data/data_list.rb', line 35
def config_table
@config_table ||= data_table.to_s.safe_constantize
end
|
17
18
19
20
21
22
23
|
# File 'app/models/rails_data/data_list.rb', line 17
def form_parameters
r = parameters.map { |k, v| { key: k, value: v } }
if r.blank?
r = [{ key: nil, value: nil }]
end
Settings.new(r)
end
|
#rebuild! ⇒ Object
13
14
15
|
# File 'app/models/rails_data/data_list.rb', line 13
def rebuild!
self.save
end
|
#update_parameters ⇒ Object
25
26
27
|
# File 'app/models/rails_data/data_list.rb', line 25
def update_parameters
self.parameters = config_params
end
|