我正在遗留数据库表上创建一个rails应用程序.一切都在本地工作正常,但在服务器上,每当我做Article.find(1)时我都会遇到此错误
Could not log "sql.active_record" event. NoMethodError: undefined method `name' for nil:NilClass ActiveRecord::StatementInvalid: PG::Error: ERROR: zero-length delimited identifier at or near """" LINE 1: SELECT "articles".* FROM "articles" WHERE "articles"."" = $1 LIMIT 1
旧数据库有一个id字段,但架构描述了id
create_table "articles",:id => false,:force => true do |t| t.decimal "id",:precision => 10,:scale => 0,:null => false ...
请注意,Article.find_by_id(1)返回记录没有任何问题.
任何想法如何解决这一问题?