问题
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
回答1:
try using globalize3 beta:
gem 'globalize3', '0.2.0.beta8'
来源:https://stackoverflow.com/questions/9173499/relation-translations-does-not-exist-after-migrating-to-rails-3-2-1