Skip to content

Rails 3 deprecation fixes #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/prawnto/template_handlers/base.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module Prawnto
module TemplateHandlers
class Base < ::ActionView::TemplateHandler
include ::ActionView::TemplateHandlers::Compilable

def compile(template)
class Base

def self.call(template)
"_prawnto_compile_setup;" +
"pdf = Prawn::Document.new(@prawnto_options[:prawn]);" +
"#{template.source}\n" +
Expand Down
2 changes: 1 addition & 1 deletion lib/prawnto/template_handlers/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Prawnto
module TemplateHandlers
class Dsl < Base

def compile(template)
def self.call(template)
"_prawnto_compile_setup(true);" +
"pdf = Prawn::Document.new(@prawnto_options[:prawn]);" +
"pdf.instance_eval do; #{template.source}\nend;" +
Expand Down
2 changes: 1 addition & 1 deletion lib/prawnto/template_handlers/raw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Prawnto
module TemplateHandlers
class Raw < Base

def compile(template)
def self.call(template)
#TODO: what's up with filename here? not used is it?
source,filename = massage_template_source(template)
"_prawnto_compile_setup;" +
Expand Down