Skip to content

Commit 6327114

Browse files
Graham Bouvierharmonymjb
Graham Bouvier
authored andcommitted
Don't use globalize friendly_id for slug unless slug is translatable
1 parent 780056d commit 6327114

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/decorators/models/solidus_globalize/spree/product_decorator.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ def self.prepended(base)
88
base.class_eval do
99
translates(*translatable_fields, fallbacks_for_empty_translations: true)
1010

11-
friendly_id :slug_candidates, use: [:history, :globalize]
11+
if translatable_fields.include?(:slug)
12+
friendly_id :slug_candidates, use: [:history, :globalize]
13+
end
1214

1315
include SolidusGlobalize::Translatable
1416

0 commit comments

Comments
 (0)