Module: Plutonium::Core::Controllers::EntityScoping
- Extended by:
- ActiveSupport::Concern
- Included in:
- Plutonium::Core::Controller
- Defined in:
- lib/plutonium/core/controllers/entity_scoping.rb
Overview
EntityScoping module provides functionality for scoping controllers to specific entities.
This module is designed to be included in controllers that need to operate within the context of a specific entity, such as a user’s organization or a project.
Instance Method Summary collapse
-
#scoped_entity_class ⇒ Class
Returns the class of the scoped entity.
-
#scoped_entity_param_key ⇒ Symbol
Returns the parameter key used for entity scoping.
- #scoped_entity_route_key ⇒ Object
-
#scoped_entity_strategy ⇒ Symbol
Returns the strategy used for entity scoping.
-
#scoped_to_entity? ⇒ Boolean
Checks if the current engine is scoped to an entity.
Instance Method Details
#scoped_entity_class ⇒ Class
Returns the class of the scoped entity.
55 56 57 58 |
# File 'lib/plutonium/core/controllers/entity_scoping.rb', line 55 def scoped_entity_class ensure_legal_entity_scoping_method_access!(__method__) current_engine.scoped_entity_class end |
#scoped_entity_param_key ⇒ Symbol
Returns the parameter key used for entity scoping.
41 42 43 44 |
# File 'lib/plutonium/core/controllers/entity_scoping.rb', line 41 def scoped_entity_param_key ensure_legal_entity_scoping_method_access!(__method__) current_engine.scoped_entity_param_key end |
#scoped_entity_route_key ⇒ Object
46 47 48 49 |
# File 'lib/plutonium/core/controllers/entity_scoping.rb', line 46 def scoped_entity_route_key ensure_legal_entity_scoping_method_access!(__method__) current_engine.scoped_entity_route_key end |
#scoped_entity_strategy ⇒ Symbol
Returns the strategy used for entity scoping.
33 34 35 |
# File 'lib/plutonium/core/controllers/entity_scoping.rb', line 33 def scoped_entity_strategy current_engine.scoped_entity_strategy end |
#scoped_to_entity? ⇒ Boolean
Checks if the current engine is scoped to an entity.
26 27 28 |
# File 'lib/plutonium/core/controllers/entity_scoping.rb', line 26 def scoped_to_entity? current_engine.scoped_to_entity? end |