class Identity < OmniAuth::Identity::Models::ActiveRecord
validates :name, :presence => true
validates :email, :presence => true, :email => true
end
When trying to use the class, I get this lovely error from Postgres:
ActiveRecord::StatementInvalid (PGError: ERROR: relation "active_records" does not exist
LINE 4: WHERE a.attrelid = '"active_records"'::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 = '"active_records"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
):
It seems through the combination of AR's abstract_class and inheritance something is going wrong. Adding a self.table_name = "identities" solves the problem though:
Here is my
Identity
model:When trying to use the class, I get this lovely error from Postgres:
It seems through the combination of AR's
abstract_class
and inheritance something is going wrong. Adding aself.table_name = "identities"
solves the problem though: