lib/ruby-app/environment.rb in ruby-app-0.1.11 vs lib/ruby-app/environment.rb in ruby-app-0.1.12
- old
+ new
@@ -20,10 +20,14 @@
# gems from app
Bundler.require(:default, App.env.to_sym)
# AS dependencies
# i prefer 2.seconds, or x.blank? functions by default
+require 'active_support/version'
+if ActiveSupport::VERSION::MAJOR >= 5
+ require 'active_support'
+end
require 'active_support/dependencies'
require 'active_support/core_ext/numeric/time'
require 'active_support/core_ext/object/blank'
# load application app
@@ -71,13 +75,13 @@
require File.expand_path(path)
end
end
# load initializers app
-Dir["#{App.root}/config/initializers/*.rb"].each{ |x| load(x) }
+Dir["#{App.root}/config/initializers/**/*.rb"].each{ |x| load(x) }
# first load models app
-Dir["#{App.root}/app/models/*.rb"].each{ |x| require x }
+Dir["#{App.root}/app/models/**/*.rb"].each{ |x| require x }
# later controllers app
-Dir["#{App.root}/app/controllers/*.rb"].each{ |x| require x }
+Dir["#{App.root}/app/controllers/**/*.rb"].each{ |x| require x }