Unfortunately my AdminUser class is not recognized as a MTI class. :(
I'm running Rails 4.2.10 and this is my setup:
ActiveRecord::Migration.create_table :users do |t|
t.string :first_name, :last_name
t.timestamps null: false
end
ActiveRecord::Migration.create_table :admin_users, inherits: :users do |t|
t.text :roles, array: true, default: [], null: false
end
# db/structure.rb
CREATE TABLE users (
id integer NOT NULL,
first_name character varying,
last_name character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
);
CREATE TABLE admin_users (
roles text[] DEFAULT '{}'::text[] NOT NULL
)
INHERITS (users);
# app/models/application_record.rb
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
# app/models/user.rb
class User < ApplicationRecord
end
class AdminUser < User
end
When I check AdminUser.mti_type_column and AdminUser.tableoid_column on the console, they are both nil, which they shouldn't be according to the specs.
What can I do to further help debugging this problem?
Unfortunately my
AdminUserclass is not recognized as a MTI class. :(I'm running Rails 4.2.10 and this is my setup:
When I check
AdminUser.mti_type_columnandAdminUser.tableoid_columnon the console, they are bothnil, which they shouldn't be according to the specs.What can I do to further help debugging this problem?