lib/hanami/controller/configuration.rb in hanami-controller-1.2.0 vs lib/hanami/controller/configuration.rb in hanami-controller-1.3.0.beta1
- old
+ new
@@ -94,11 +94,11 @@
# # => will duplicate from Hanami::Controller
#
# Hanami::Controller::Configuration.for(MyApp::Controllers::Dashboard)
# # => will duplicate from MyApp::Controller
def self.for(base)
- namespace = Utils::String.namespace(base)
- framework = Utils::Class.load_from_pattern!("(#{namespace}|Hanami)::Controller")
+ namespace = Utils::String.namespace(base.name)
+ framework = Utils::Class.load("#{namespace}::Controller") || Utils::Class.load!('Hanami::Controller')
framework.configuration.duplicate
end
# Initialize a configuration instance
#