Class: Wallaby::ControllerFinder
- Inherits:
-
ClassFinder
- Object
- ClassFinder
- Wallaby::ControllerFinder
- Defined in:
- lib/services/wallaby/controller_finder.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from ClassFinder
#current_controller_class, #model_class, #script_name
Instance Method Summary collapse
-
#execute ⇒ Class
Find controller class by script name and model class from the following places:.
Instance Method Details
#execute ⇒ Class
Find controller class by script name and model class from the following places:
-
#current_controller_class if #current_controller_class‘s model is the same as given #model_class
-
possible controller class built from script name and model class, e.g. /admin and Order::Item will give us the possible controller ‘Admin::Order::ItemsController`
16 17 18 19 20 |
# File 'lib/services/wallaby/controller_finder.rb', line 16 def execute return current_controller_class if model_class == current_controller_class.try(:model_class) possible_default_class || current_controller_class.try(:application_controller) end |