Class: ActiveRecord::Materialized::TableModelRegistry Private
- Inherits:
-
Object
- Object
- ActiveRecord::Materialized::TableModelRegistry
- 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.
10 11 12 13 14 |
# File 'lib/activerecord/materialized/table_model_registry.rb', line 10 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.
16 17 18 |
# File 'lib/activerecord/materialized/table_model_registry.rb', line 16 def resolve(table_name) explicit[table_name] || find_descendant(table_name) end |