From 5d8c1556a8bbfb1e2762f2d233d4f14a97c1e8ea 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 9bc2c7f4..924b6069 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