Class: ActiveRecord::Materialized::TableModelRegistry Private
- Inherits:
-
Object
- Object
- ActiveRecord::Materialized::TableModelRegistry
- Extended by:
- T::Sig
- Defined in:
- lib/activerecord/materialized/table_model_registry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Maps table names to their ActiveRecord models for dependency wiring.
Class Method Summary collapse
- .register(model_class) ⇒ Object private
- .resolve(table_name) ⇒ Object private
Class Method Details
.register(model_class) ⇒ 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.
14 15 16 17 18 |
# File 'lib/activerecord/materialized/table_model_registry.rb', line 14 def register(model_class) return if model_class.abstract_class? explicit[model_class.table_name] = model_class end |
.resolve(table_name) ⇒ 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.
21 22 23 |
# File 'lib/activerecord/materialized/table_model_registry.rb', line 21 def resolve(table_name) explicit[table_name] || find_descendant(table_name) end |