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:
parent
2562c2b787
commit
f7fb11ed85
2 changed files with 14 additions and 8 deletions
11
lib/ap.rb
11
lib/ap.rb
|
@ -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'])
|
||||||
|
|
|
@ -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'])
|
||||||
|
|
Loading…
Reference in a new issue