def nested_attribute_type(attribute)
        if self < ActiveRecord::Base && !schema_loaded?
          store_model_attribute_types[attribute.to_s]
        else
          attribute_types[attribute.to_s]
        end
      end
when db connection is not available, it becomes impossible to read attributes types from
ActiveModel::AttributeRegistration::ClassMethods.attribute_types, because activerecord
overrides _default_attributes and triggers db connection.
for activerecord model only use attribute_types if it has db connected

@param attribute [String, Symbol]
@return [StoreModel::Types::Base, nil]