5

I'm using friendly_id (4.10.1) and globalize (3.0.0) in my Rails 3.2.14 app:

# globalize3
translates :title, :slug

# friendly_id    
extend FriendlyId
friendly_id :title, use: [:slugged, :globalize]

When I save my inputs, friendly_id checks for slug collisions:

SELECT "pages".* FROM "pages" WHERE
("slug" = 'my-title' OR "slug" LIKE 'my-title--%') AND (id <> 1)
ORDER BY LENGTH("slug") DESC, "slug" DESC LIMIT 1

Friendly_id should use the translation table page_translations for this, because the entry in the original table pages is kinda random when you use multiple locales.

And that's the problem: friendly_id only recognizes slug collisions for one language/locale.

Does anyone have an idea how to alter the query for full globalize support? Thank you very much in advance!

Charles
  • 50,943
  • 13
  • 104
  • 142
Railsana
  • 1,813
  • 2
  • 21
  • 30
  • Thanks for noticing this. Can you post an issue about this on the [globalize github repository](https://github.com/globalize/globalize)? – Chris Salzberg Nov 12 '13 at 05:38

0 Answers0