spree/spree — Issue #1232: Product permalink translated from russian with letter "Ь"
Author: deemytch
Created: 2012-03-05 15:00:15+00:00
State: open

/cc biow0lf

spree 1.0, rails 3.1.3, postgresql, linux x64

When creating products group in admin interface, if name is entered on russian with letter "Ь" (soft sign) with have to be translated (why?) to single quote, for ex. "Обувь (shoes) -> Obuv' " this parameter gets passed directly to postgresql in a form

"e_product_groups" WHERE (permalink LIKE 'Obuv'%') ORDER" etc

that sure throws an error.

In ROR2RU google group user Solenko suppose:
( https://groups.google.com/forum/?fromgroups#!topic/ror2ru/yfGFuZb2B60 )

https://github.com/spree/spree/blob/master/core/lib/spree/core/permalinks.rb#L43

:conditions => "#{field} LIKE '#{permalink_value}%'",

fix

:conditions => ["#{field} LIKE '?'", "#{permalink_value}%"],

BUT I think for the correct translation for permalinks is better to get out from any quotes at all, because of unpredictable manner of appearance of new errors when using quotes and other special symbols in names.