fix: Validate avatar only when it has changed (#3849)

This commit is contained in:
Shivam Chahar
2022-01-27 05:31:41 +05:30
committed by GitHub
parent 59deffc7e3
commit 8e6d8e7654

View File

@@ -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