1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Make sure active_record and active_support mixins get loaded in Rails console when required from .irbrc

This commit is contained in:
Mike Dvorkin 2011-02-02 22:19:05 -08:00
parent 2562c2b787
commit f7fb11ed85
2 changed files with 14 additions and 8 deletions

View file

@ -8,7 +8,10 @@
end end
require File.dirname(__FILE__) + "/ap/awesome_print" require File.dirname(__FILE__) + "/ap/awesome_print"
require File.dirname(__FILE__) + "/ap/core_ext/logger" if defined?(::Logger) require File.dirname(__FILE__) + "/ap/core_ext/logger" if defined?(Logger)
require File.dirname(__FILE__) + "/ap/mixin/action_view" if defined?(::ActionView) require File.dirname(__FILE__) + "/ap/mixin/action_view" if defined?(ActionView)
require File.dirname(__FILE__) + "/ap/mixin/active_record" if defined?(::ActiveRecord)
require File.dirname(__FILE__) + "/ap/mixin/active_support" if defined?(::ActiveSupport) # Load the following under normal circumstatnces as well as in Rails
# console when required from ~/.irbrc.
require File.dirname(__FILE__) + "/ap/mixin/active_record" if defined?(ActiveRecord) || (defined?(IRB) && ENV['RAILS_ENV'])
require File.dirname(__FILE__) + "/ap/mixin/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])

View file

@ -15,7 +15,10 @@
end end
require File.dirname(__FILE__) + "/ap/awesome_print" require File.dirname(__FILE__) + "/ap/awesome_print"
require File.dirname(__FILE__) + "/ap/core_ext/logger" if defined?(::Logger) require File.dirname(__FILE__) + "/ap/core_ext/logger" if defined?(Logger)
require File.dirname(__FILE__) + "/ap/mixin/action_view" if defined?(::ActionView) require File.dirname(__FILE__) + "/ap/mixin/action_view" if defined?(ActionView)
require File.dirname(__FILE__) + "/ap/mixin/active_record" if defined?(::ActiveRecord)
require File.dirname(__FILE__) + "/ap/mixin/active_support" if defined?(::ActiveSupport) # Load the following under normal circumstatnces as well as in Rails
# console when required from ~/.irbrc.
require File.dirname(__FILE__) + "/ap/mixin/active_record" if defined?(ActiveRecord) || (defined?(IRB) && ENV['RAILS_ENV'])
require File.dirname(__FILE__) + "/ap/mixin/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])