added migrate function to reports.

pull/6827/head
Philipp Tessenow 14 years ago
parent db7ffe25e6
commit 0631eab974
  1. 10
      lib/report.rb

@ -43,6 +43,16 @@ class Report < ActiveRecord::Base
end end
end end
##
# Migrates this report to look like the given report.
# This may be used to alter report properties without
# creating a new report in a database.
def migrate(report)
[:@query, :@transformer, :@walker, :@table, :@depths, :@chain_initializer].each do |inst_var|
instance_variable_set inst_var, (report.instance_variable_get inst_var)
end
end
def available_filters def available_filters
self.class::Filter.all self.class::Filter.all
end end

Loading…
Cancel
Save