lib/friendly_id/base.rb in friendly_id-5.0.1 vs lib/friendly_id/base.rb in friendly_id-5.0.2
- old
+ new
@@ -244,7 +244,12 @@
diff.first || diff.second
else
friendly_id.presence.to_param || super
end
end
+
+ # Clears slug on duplicate records when calling `dup`.
+ def dup
+ super.tap { |duplicate| duplicate.slug = nil }
+ end
end
end