...
module Photocase
class Application < Rails::Application
# Load core extensions from <tt>lib/core_ext</tt> and all sub folders
# as the very first initializer.
initializer 'photocase.core_extensions', before: :load_config_initializers do |app|
Dir.glob(Rails.root.join('lib', 'core_ext', '**', '*.rb')).each{ |f| require f}
end
...
end
end