I am creating a rails application on top of an old database table. Everything works fine locally, but on the server, I hit this error whenever I do 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
The legacy database has an id field, however the schema describes the identifier using
create_table "articles", :id => false, :force => true do |t| t.decimal "id", :precision => 10, :scale => 0, :null => false ...
Note that Article.find_by_id (1) returns the record without any problems.
Any ideas how to fix this?
activerecord exception postgresql ruby-on-rails-3
user208769
source share