Created
October 1, 2018 16:27
-
-
Save 8vius/ffacaff77e90b5c1243d2bd263c73a6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PdfController < ActionController::Base | |
include PdfGeneration | |
expose :report | |
def self.draw_report(draw) | |
run { build_draw_report(draw) } | |
end | |
def self.portfolio_report(portfolio) | |
run { build_portfolio_report(portfolio) } | |
end | |
def self.run(&block) | |
c = new | |
c.request = ActionDispatch::TestRequest.create({}) | |
c.response = ActionDispatch::TestResponse.create | |
c.instance_eval(&block) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment