我从Rails 3.1.3迁移到3.2.1并在加载主页时出现以下错误:
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
当globalize3 gem尝试构建page_meta_tags和page_meta_tag_translations表之间的关系时,会发生这种情况。在Rails 3.1.3上一切正常。是否可能是由于新的Active Record和globalize3不兼容?任何人都有同样的事情吗?
class PageMetaTag < ActiveRecord::Base
translates :title, :description, :keywords
accepts_nested_attributes_for :translations
end
答案 0 :(得分:1)
尝试使用globalize3 beta:
gem 'globalize3', '0.2.0.beta8'