From 0b3aab39c4c3bb6afb46443e5469c8c475d21331 Mon Sep 17 00:00:00 2001 From: Zog Date: Wed, 28 Mar 2018 09:52:49 +0200 Subject: Update simple_exporter Enable access to the context in the `map_item_to_rows` block --- app/models/simple_exporter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/simple_exporter.rb b/app/models/simple_exporter.rb index c267b5b8c..1fcb76a29 100644 --- a/app/models/simple_exporter.rb +++ b/app/models/simple_exporter.rb @@ -64,7 +64,7 @@ class SimpleExporter < SimpleInterface def map_item_to_rows item return [item] unless configuration.item_to_rows_mapping - configuration.item_to_rows_mapping.call(item).map {|row| row.is_a?(ActiveRecord::Base) ? row : CustomRow.new(row) } + instance_exec(item, &configuration.item_to_rows_mapping).map {|row| row.is_a?(ActiveRecord::Base) ? row : CustomRow.new(row) } end def resolve_value item, col -- cgit v1.2.3