• E
    Only define attribute methods from schema cache · 00075016
    Eugene Kenny 提交于
    To define the attribute methods for a model, Active Record needs to know
    the schema of the underlying table, which is usually achieved by making
    a request to the database. This is undesirable behaviour while the app
    is booting, for two reasons: it makes the boot process dependent on the
    availability of the database, and it means every new process will make
    one query for each table, which can cause issues for large applications.
    
    However, if the application is using the schema cache dump feature, then
    the schema cache already contains the necessary information, and we can
    define the attribute methods without causing any extra database queries.
    00075016
internal_metadata.rb 1.2 KB