You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.
(0.3ms) UPDATE "translations" SET "lang" = 'zh=>旅游折扣券/赠票', "updated_at" = '2013-01-02 00:46:35.002511' WHERE "translations"."id" = 50
ERROR: Syntax error near '?' at position 7
LINE 1: UPDATE "translations" SET "lang" = 'zh=>旅游折扣券/赠票', "u...
ArgumentError: invalid byte sequence in UTF-8
from /Users/incubus/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1141:in ===' from /Users/incubus/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1141:intranslate_exception'
I don't see quotes in SET "lang" = 'zh=>旅游折扣券/赠票' and it also breaks postgresql adapter error output.
Hi! Happy New Year!
I just want to migrate from serialization to hstore and get the strange error:
irb(main):012:0> t = Translation.find(50)
The old serialization:
irb(main):013:0> t.languages
=> {:ru=>"Скидка купоны/подарочные билеты путешествия", :en=>"Travel discount coupons/gift tickets", :zh=>"旅游折扣券/赠票", :fr=>"Voyage rabais coupons cadeaux billets", :de=>"Rabatt-Gutscheine/Gift Fahrkarten"}
The new hstore:
irb(main):014:0> t.lang = { 'zh' => t.languages[:zh] }
=> {"zh"=>"旅游折扣券/赠票"}
irb(main):015:0> t.save
(0.3ms) UPDATE "translations" SET "lang" = 'zh=>旅游折扣券/赠票', "updated_at" = '2013-01-02 00:46:35.002511' WHERE "translations"."id" = 50
ERROR: Syntax error near '?' at position 7
LINE 1: UPDATE "translations" SET "lang" = 'zh=>旅游折扣券/赠票', "u...
ArgumentError: invalid byte sequence in UTF-8
from /Users/incubus/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1141:in
===' from /Users/incubus/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1141:in
translate_exception'I don't see quotes in SET "lang" = 'zh=>旅游折扣券/赠票' and it also breaks postgresql adapter error output.
It works fine with ASCII:
irb(main):016:0> t.lang = { 'en' => t.languages[:en] }
=> {"en"=>"Travel discount coupons/gift tickets"}
irb(main):017:0> t.save
(0.2ms) UPDATE "translations" SET "lang" = 'en=>"Travel discount coupons/gift tickets"', "updated_at" = '2013-01-02 00:48:39.191811' WHERE "translations"."id" = 50
=> true
The text was updated successfully, but these errors were encountered: