Class: Wallaby::DecoratorFinder
- Inherits:
-
ClassFinder
- Object
- ClassFinder
- Wallaby::DecoratorFinder
- Defined in:
- lib/services/wallaby/decorator_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 decorator class by script name and model class from the following places:.
Instance Method Details
#execute ⇒ Class
Find decorator class by script name and model class from the following places:
-
#controller_class‘s #resource_decorator
-
possible decorator class built from script name and model class, e.g. /admin and Order::Item will give us the possible decorators:
-
Admin::Order::ItemDecorator
-
Order::ItemDecorator
-
ItemDecorator
-
-
#controller_class‘s default #application_decorator
17 18 19 20 21 |
# File 'lib/services/wallaby/decorator_finder.rb', line 17 def execute controller_class.resource_decorator || possible_default_class || controller_class.application_decorator end |