mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Lazy-load ActionView via ActiveSupport.on_load hook
Referencing ActionView::Base constant would kick :action_view load_hooks. This should better not happen for Rails apps when loading bundled awesome_print gem.
This commit is contained in:
parent
63961069bb
commit
60115807e6
1 changed files with 5 additions and 1 deletions
|
@ -25,7 +25,11 @@ unless defined?(AwesomePrint::Inspector)
|
|||
#
|
||||
# Load remaining extensions.
|
||||
#
|
||||
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView::Base)
|
||||
if defined?(ActiveSupport)
|
||||
ActiveSupport.on_load(:action_view) do
|
||||
require File.dirname(__FILE__) + "/awesome_print/ext/action_view"
|
||||
end
|
||||
end
|
||||
require File.dirname(__FILE__) + "/awesome_print/ext/mongo_mapper" if defined?(MongoMapper)
|
||||
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid)
|
||||
require File.dirname(__FILE__) + "/awesome_print/ext/nokogiri" if defined?(Nokogiri)
|
||||
|
|
Loading…
Reference in a new issue