Skip to content

Commit

Permalink
Merge pull request mbleigh#58 from brian4d/fix_for_rails5
Browse files Browse the repository at this point in the history
Fix for rails5
  • Loading branch information
modsognir authored Jul 31, 2017
2 parents 3878624 + 3096479 commit 1554f41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/princely/pdf_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def self.included(base)
base.send :alias_method, :render, :render_with_princely
end

def self.prepended(base)
base.send :alias_method, :render_without_princely, :render
base.send :alias_method, :render, :render_with_princely
end

def render_with_princely(options = nil, *args, &block)
if options.is_a?(Hash) && options.has_key?(:pdf)
options[:name] ||= options.delete(:pdf)
Expand Down
1 change: 1 addition & 0 deletions lib/princely/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
if defined?(Rails)
if Rails::VERSION::MAJOR >= 5
ActionController::Base.send(:prepend, Princely::PdfHelper)
ActionController::Base.send(:include, Princely::AssetSupport)
else
ActionController::Base.send(:include, Princely::PdfHelper)
end
Expand Down

0 comments on commit 1554f41

Please sign in to comment.