From 98b2e8c4398cf3a6638f9e35b2714304994aaa26 Mon Sep 17 00:00:00 2001 From: Yuri Rudman Date: Wed, 9 Jan 2019 11:09:38 -0500 Subject: [PATCH] MiqReport::ImportExport.export_to_array method was modifyied to add 2 attributes which are not present in the MqReport model: 'userid' and 'group_description'. We need those attributes to import saved report in mutiregion environment, BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1638533. To make sure that MiqReport#update_attributes(saved_report_atributes) will not raise error, we need to implement stub for assignment method for those added attributes --- app/models/miq_report.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/miq_report.rb b/app/models/miq_report.rb index f37c42707ef..34d07791825 100644 --- a/app/models/miq_report.rb +++ b/app/models/miq_report.rb @@ -242,6 +242,16 @@ def self.display_name(number = 1) n_('Report', 'Reports', number) end + def userid=(_userid) + # there are no MiqReport.userid and MiqReport.group_description attributes and after adding 'userid' + # and 'group_description' to a saved report, we need this stub to allow mass assignment + # when updating attrbutes using saved output from MiqReport::ImportExport#export_to_array + end + + def group_description=(_group_description) + # need this stub to allow mass assignment when updating attrbutes + end + private def va_sql_cols