airblade/paper_trail — Issue #130: paper trail not working correctly after upgrade to rails 3.2.1
Author: lefthandmagic
Created: 2012-02-07 17:08:18+00:00
State: open

I was earlier on rails 3.1 and didn't face any issues.

My revision is setup as below
in app/model/movie.rb
class Movie < ActiveRecord::Base
has_paper_trail :class_name => 'MovieRevision'
end

app/versions/movie_revision.rb
class MovieRevision < Version
set_table_name :movie_revisions
end

when I try to do an update call on my Movie model I get this error.
I'm not sure if anything changed in rails 3.2.1 which isn't compatible with paper trail. I was originally on 2.4.0 when I identified this issue. I upgraded to 2.6.0, but still am facing this issue.

PGError: ERROR: relation "versions" does not exist
LINE 4: WHERE a.attrelid = '"versions"'::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 = '"versions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

(0.1ms) ROLLBACK
Completed 500 Internal Server Error in 24ms

Any help will be great .Thank you.