Story#108602614 - one more speed optimization

This commit is contained in:
Vladimir Krylov 2016-01-07 09:20:24 +02:00
parent f02ebe5559
commit 34aa3c0741
3 changed files with 8 additions and 2 deletions

View file

@ -30,5 +30,11 @@ module Legacy
@new_registrar_cache ||= {}
@new_registrar_cache[old_id] ||= ::Registrar.select(:id).find_by(legacy_id: old_id)
end
def self.new_api_user_cached old_id
@new_api_user_cache ||= {}
@new_api_user_cache[old_id] ||= Legacy::Domain.new_registrar_cached(old_id).try(:api_users).try(:first)
end
end
end