method
load_cache
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::SchemaReflection
load_cache(connection)private
No documentation available.
# File activerecord/lib/active_record/connection_adapters/schema_cache.rb, line 124
def load_cache(connection)
# Can't load if schema dumps are disabled
return unless possible_cache_available?
# Check we can find one
return unless new_cache = SchemaCache._load_from(@cache_path)
if self.class.check_schema_cache_dump_version
begin
current_version = connection.schema_version
if new_cache.version(connection) != current_version
warn "Ignoring #{@cache_path} because it has expired. The current schema version is #{current_version}, but the one in the schema cache file is #{new_cache.schema_version}."
return
end
rescue ActiveRecordError => error
warn "Failed to validate the schema cache because of #{error.class}: #{error.message}"
return
end
end
new_cache
end