Module: Upgrow::ActiveRecordQueries::ClassMethods
- Defined in:
- lib/upgrow/active_record_queries.rb
Overview
Class methods for classes that include this module.
Instance Method Summary collapse
-
#default_base ⇒ Class
Callback method used by Basic Repository to set a default Repository base when one is not explicitly provided at the Repository initialization.
Instance Method Details
#default_base ⇒ Class
Callback method used by Basic Repository to set a default Repository base when one is not explicitly provided at the Repository initialization.
It attempts to find a constant based on the Repository name, with the ‘Record` suffix as a convention. For example, a `UserRepository` would have the `UserRecord` as its base. That is the naming convention for Active Record classes under this architecture.
21 22 23 |
# File 'lib/upgrow/active_record_queries.rb', line 21 def default_base Object.const_get(Naming.repository_to_record(name)) end |