From 8e6d8e765476a08893dabafbb77746f929a12910 Mon Sep 17 00:00:00 2001 From: Shivam Chahar Date: Thu, 27 Jan 2022 05:31:41 +0530 Subject: [PATCH] fix: Validate avatar only when it has changed (#3849) --- app/models/concerns/avatarable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb index 441afa106..b17a0bdbf 100644 --- a/app/models/concerns/avatarable.rb +++ b/app/models/concerns/avatarable.rb @@ -6,7 +6,7 @@ module Avatarable included do has_one_attached :avatar - validate :acceptable_avatar + validate :acceptable_avatar, if: -> { avatar.changed? } end def avatar_url