Skip to content

Commit

Permalink
Don't use globalize friendly_id for slug unless slug is translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Bouvier authored and harmonymjb committed Jan 23, 2025
1 parent 16bb2ad commit ab8abd1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def self.prepended(base)
base.class_eval do
translates(*translatable_fields, fallbacks_for_empty_translations: true)

friendly_id :slug_candidates, use: [:history, :globalize]
if translatable_fields.include?(:slug)
friendly_id :slug_candidates, use: [:history, :globalize]
end

include SolidusGlobalize::Translatable

Expand Down

0 comments on commit ab8abd1

Please sign in to comment.