From 65fc38ef368b4561ef739074f1eb484740946145 Mon Sep 17 00:00:00 2001 From: Johnny Shields <27655+johnnyshields@users.noreply.github.com> Date: Sun, 21 Apr 2024 10:53:59 +0900 Subject: [PATCH] Update slug.rb --- lib/mongoid/slug.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongoid/slug.rb b/lib/mongoid/slug.rb index 70c5c21..1f34b49 100644 --- a/lib/mongoid/slug.rb +++ b/lib/mongoid/slug.rb @@ -307,7 +307,7 @@ def new_with_slugs? def persisted_with_slug_changes? if localized? changes = _slugs_change - return (persisted? && false) if changes.nil? + return false if changes.nil? # ensure we check for changes only between the same locale original = changes.first.try(:fetch, I18n.locale.to_s, nil)