From a8f93b29e1e154a082be747e67a15f51c0ff1dd5 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 13 May 2023 17:43:02 -0300 Subject: [PATCH] fix: no fallar si no existe el Gemfile.lock #13428 --- app/models/site.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/site.rb b/app/models/site.rb index 04505f49..a67b3b5b 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -587,8 +587,15 @@ class Site < ApplicationRecord updated_at < File.mtime(File.join(path, 'Gemfile')) end + # @return [String] + def gemfile_lock_path + @gemfile_lock_path ||= File.join(path, 'Gemfile.lock') + end + # Detecta si el Gemfile.lock fue modificado def gemfile_lock_updated? - updated_at < File.mtime(File.join(path, 'Gemfile.lock')) + return false unless File.exist? gemfile_lock_path + + updated_at < File.mtime(gemfile_lock_path) end end