Class: ROM::Registries::Schemas
- Includes:
- Nestable
- Defined in:
- lib/rom/registries/schemas.rb
Instance Method Summary collapse
-
#canonical(provider) ⇒ Schema
Resolve relation's canonical schema.
- #define_component(**options) ⇒ Object private
- #fetch(key, &block) ⇒ Object (also: #[]) included from Nestable
- #unscoped ⇒ Object private
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Registries::Root
Instance Method Details
#canonical(provider) ⇒ Schema
Resolve relation's canonical schema
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rom/registries/schemas.rb', line 17 def canonical(provider) schema = scoped(provider.config.component.id).fetch(provider.config.component.dataset) { fetch(provider.config.component.id) } if schema.is_a?(self.class) unscoped.fetch(provider.config.component.id) else schema end end |
#define_component(**options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 41 |
# File 'lib/rom/registries/schemas.rb', line 35 def define_component(**) return super unless provider_type == :relation comp = components.get(:schemas, relation: config.component.id, abstract: false) comp || super(**, relation_id: config.component.id) end |
#fetch(key, &block) ⇒ Object Also known as: [] Originally defined in module Nestable
#unscoped ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/rom/registries/schemas.rb', line 30 def unscoped root.schemas end |