环境:Rails 3.2.11
添加了 paper_trail 宝石。
请注意,我已经使用了那个 gem,我从来没有遇到过问题,但是这次我遇到了一个错误,我找不到原因。
在我的模型中:
class User < ActiveRecord::Base
has_paper_trail :versions => :paper_trail_versions
...
end
错误:
User Exists (0.6ms) SELECT 1 AS one FROM "users" WHERE ("users"."pseudo" = 'joel' AND "users"."id" != 21) LIMIT 1
PG::Error: ERROR: relation "versions" does not exist
LINE 5: WHERE a.attrelid = '"versions"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"versions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
(0.1ms) ROLLBACK
Completed 500 Internal Server Error in 28ms
ActiveRecord::StatementInvalid (PG::Error: ERROR: relation "versions" does not exist
LINE 5: WHERE a.attrelid = '"versions"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"versions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
)
有关如何解决此问题的任何线索?