0

I have my slug candidates set as :

def slug_candidates
  [
    :full_name,
    [:full_name, :location],
    :display_name
  ]
end

def should_generate_new_friendly_id?
    full_name_changed? || location_changed? || display_name_changed?
end

But if I update the display_name, the slug generated is the display name -- even though the first candidate is available (full_name).

Any idea on why that would be the case?

Shouldn't updating a field look at the candidates array again to generate the new slug?

Hopstream
  • 6,391
  • 11
  • 50
  • 81
  • I think that the `should_generate_new_friendly_id?` method is going to take whatever is changed, and update the slug. So that seems to be the case with you. – Dudo Dec 29 '13 at 01:37
  • For anyone that finds this in the future, Hopstream has reached out to the FriendlyId creators in a Github Issue: https://github.com/norman/friendly_id/issues/508 – tdooner Dec 29 '13 at 04:24
  • @tdooner Yeah, seems to be a bug in Friendly_id. Found a temporary way around for this for now (posted on github). – Hopstream Dec 29 '13 at 04:38

0 Answers0