module Upgrow::ActiveRecordQueries::ClassMethods

Class methods for classes that include this module.

Public Instance Methods

default_base() click to toggle source

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.

@return [Class] the Active Record Base class to be used as the

Repository base according to the architecture's naming convention.
# File lib/upgrow/active_record_queries.rb, line 21
def default_base
  Object.const_get(Naming.repository_to_record(name))
end