سؤال

I migrated from Rails 3.1.3 to 3.2.1 and got the following error when loading the home page:

PGError: ERROR:  relation "translations" does not exist
LINE 4:              WHERE a.attrelid = '"translations"'::regclass
                                    ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
          FROM pg_attribute a LEFT JOIN pg_attrdef d
            ON a.attrelid = d.adrelid AND a.attnum = d.adnum
         WHERE a.attrelid = '"translations"'::regclass
           AND a.attnum > 0 AND NOT a.attisdropped
         ORDER BY a.attnum

This happens when globalize3 gem tries to build the relation between page_meta_tags and page_meta_tag_translations tables. Everything worked fine on Rails 3.1.3. Can it be due to new Active Record and globalize3 incompatibility? Anyone has the same thing?

class PageMetaTag < ActiveRecord::Base
  translates :title, :description, :keywords

  accepts_nested_attributes_for :translations
end
هل كانت مفيدة؟

المحلول

try using globalize3 beta:

gem 'globalize3', '0.2.0.beta8'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top