Created by: gracewashere
Closes #122 (closed).
Problem:
Administrate assumes that all subclasses of ActiveRecord::Base
are backed by database tables.
When a host application or gem defines a subclass of ActiveRecord::Base
that doesn't have a corresponding database table, the installation generator sees an error:
postgresql_adapter.rb:596:in `async_exec': PG::UndefinedTable: ERROR: relation "read_marks" does not exist (ActiveRecord::StatementInvalid)
LINE 5: WHERE a.attrelid = '"read_marks"'::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 = '"read_marks"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Solution:
Verify that a model's database table exists before creating the model's dashboard.