module ActiveRecord::Inheritance::ClassMethods

def primary_abstract_class

that connects to your primary database.
will share a database connection with Active Record. It is the class
ApplicationRecord for your primary abstract class. This class
This is useful if your application uses a different class than

Sets the application record class for Active Record
def primary_abstract_class
  if ActiveRecord.application_record_class && ActiveRecord.application_record_class.name != name
    raise ArgumentError, "The `primary_abstract_class` is already set to #{ActiveRecord.application_record_class.inspect}. There can only be one `primary_abstract_class` in an application."
  end
  self.abstract_class = true
  ActiveRecord.application_record_class = self
end