aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-03-28 09:52:49 +0200
committerZog2018-03-28 09:52:49 +0200
commit0b3aab39c4c3bb6afb46443e5469c8c475d21331 (patch)
treee0279bf79f567ea4258ce97d3ded23a7fe1802f9
parent54401ef8b7c61e5a440a1d2b958e78d2ba0bd236 (diff)
downloadchouette-core-6340-exporter-flatten-services.tar.bz2
Update simple_exporter6340-exporter-flatten-services
Enable access to the context in the `map_item_to_rows` block
-rw-r--r--app/models/simple_exporter.rb2
1 files changed, 1 insertions, 1 deletions
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