I migrate an application from rails 5.2 to rails 6. There is only have one thing left to do but I don't know how.
I have this depreciation warning:
DEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller. (called from new at /Users/xxx/xxxx/app/models/stock.rb:42)
from this code:
view = ActionView::Base.with_empty_template_cache.new(
ActionController::Base.view_paths,
categories: categories,
periods: periods
)
result = view.render formats: [:xlsx],
handlers: [:axlsx],
template: 'admin/reports/logistics/stocks_by_age'
I don't understand how to fix it. I went to see the depreciation in the source code, but it didn't help me figure out what I should do, and I didn't really find any documentation for this 'lookup'.
Please, could someone help me to understand this depreciation?