Class: Envyable::Railtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- Envyable::Railtie
- Defined in:
- lib/envyable/railtie.rb
Class Method Summary collapse
-
.load ⇒ Object
Avoid Rails calling ‘Kernel#load` via #method_mising.
Instance Method Summary collapse
- #load ⇒ Object
-
#root ⇒ Object
Fallback of ENV variable or current directory because Rails 4.1+ returns nil for Rails.root prior to app initialization.
Class Method Details
.load ⇒ Object
Avoid Rails calling ‘Kernel#load` via #method_mising
20 21 22 |
# File 'lib/envyable/railtie.rb', line 20 def self.load instance.load end |
Instance Method Details
#load ⇒ Object
9 10 11 |
# File 'lib/envyable/railtie.rb', line 9 def load Envyable.load root.join('config', 'env.yml'), Rails.env end |
#root ⇒ Object
Fallback of ENV variable or current directory because Rails 4.1+ returns nil for Rails.root prior to app initialization
15 16 17 |
# File 'lib/envyable/railtie.rb', line 15 def root Rails.root || Pathname.new(ENV["RAILS_ROOT"] || Dir.pwd) end |