You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
502 B
22 lines
502 B
2 years ago
|
module LogsHelper
|
||
|
def log_type_for_controller(controller)
|
||
|
case controller.class.to_s
|
||
|
when "LettingsLogsController"
|
||
|
"lettings"
|
||
|
when "SalesLogsController"
|
||
|
"sales"
|
||
|
else
|
||
|
raise "Log type not found for #{controller.class}"
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def bulk_upload_path_for_controller(controller, id:)
|
||
|
case log_type_for_controller(controller)
|
||
|
when "lettings"
|
||
|
bulk_upload_lettings_log_path(id:)
|
||
|
when "sales"
|
||
|
bulk_upload_sales_log_path(id:)
|
||
|
end
|
||
|
end
|
||
|
end
|