Created
March 27, 2020 17:02
-
-
Save jeremylenz/f693af7b547e82e3a82c55e344e2b8dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params = { format: 'html', template_id: 138, input_values: { '23' => { value: '180' } } } | |
# OR params = { format: 'html', template_id: '138-Subscription%20-%20Entitlement%20Report', input_values: { '23' => { value: '180' } | |
composer = ReportComposer.new(params) | |
composer.valid? | |
# => true | |
job = composer.schedule_rendering | |
# #<TemplateRenderJob:0x000000001131fbf8 | |
# @arguments=[{"format"=>"html", "template_id"=>138, "input_values"=>{"23"=>{"value"=>"180"}}}, {:user_id=>2}], | |
# @executions=0, | |
# @job_id="c69d83ef-5432-49e3-9e3b-1fd93be6ccb2", | |
# @priority=nil, | |
# @provider_job_id="c69d83ef-5432-49e3-9e3b-1fd93be6ccb2", | |
# @queue_name="default"> | |
job.provider_job_id | |
# => "c69d83ef-5432-49e3-9e3b-1fd93be6ccb2" | |
include Rails.application.routes.url_helpers | |
base_url = report_data_report_template_path(ReportTemplate.find(138)) | |
# => "/templates/report_templates/138-Subscription%20-%20Entitlement%20Report/report_data" | |
link_to_report = "#{base_url}?job_id=#{job.provider_job_id" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment