diff --git a/lib/gzr/modules/dashboard.rb b/lib/gzr/modules/dashboard.rb index 492a6a5..dc17357 100644 --- a/lib/gzr/modules/dashboard.rb +++ b/lib/gzr/modules/dashboard.rb @@ -250,7 +250,7 @@ def cat_dashboard(dashboard_id) data[:dashboard_elements][i][:merge_result] = merge_result end end - data[:scheduled_plans] = query_scheduled_plans_for_dashboard(@dashboard_id,"all")&.to_attrs if @options[:plans] + data[:scheduled_plans] = query_scheduled_plans_for_dashboard(@dashboard_id,"all") if @options[:plans] data end end diff --git a/lib/gzr/modules/plan.rb b/lib/gzr/modules/plan.rb index 67a33dc..bce4cc3 100644 --- a/lib/gzr/modules/plan.rb +++ b/lib/gzr/modules/plan.rb @@ -76,6 +76,7 @@ def query_scheduled_plans_for_dashboard(dashboard_id,user_id,fields=nil) say_error e.message raise end + data.map! {|plan| plan.to_attrs} data end