Class: Wallaby::ControllerFinder

Inherits:
ClassFinder show all
Defined in:
lib/services/wallaby/controller_finder.rb

Direct Known Subclasses

ServicerFinder

Instance Attribute Summary

Attributes inherited from ClassFinder

#current_controller_class, #model_class, #script_name

Instance Method Summary collapse

Instance Method Details

#executeClass

Find controller class by script name and model class from the following places:

Returns:

  • (Class)

    controller class



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