3 ms·
This is because active record models learn their attributes by querying the database scheme. I haven’t tried it but there appears to be a way to cache this in
by amichal 9y ago
This is because active record models learn their attributes by querying the database scheme. I haven’t tried it but there appears to be a way to cache this information in the local file system which would likely avoid the early dB connect if you really needed to do that. Also avoids querying the scheme on processs boot entirely if you are willing to trust the cached scheme matches the. database scheme. See https://github.com/rails/rails/issues/24133 https://github.com/rails/rails/issues/24133 for discussion