Custom table_name for design table users

for my application, I have several tables for users (francs, Belgians, ...) and I would like to use them depending on the domain I tried with table_name_prefix and table_name but it doesn't seem to work

class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, #:confirmable,
:recoverable, :rememberable, :trackable, :validatable

def self.table_name
debugger
'franceusers'
end

def self.table_name_prefix
debugger
'france'
end
end

thanks to the debugger, I see that it is called, but not self.table_name_prefix. And even if self.table_name, if called, develops user searches in user tables instead of franceusers

in the console User.table_name => "franceusers"

User.table_name_prefix => "france"

, im activeadmin, , : Mysql2:: : "franceusers.id" "order clause": SELECT. * FROM users ORDER BY franceusers.id desc LIMIT 30 OFFSET 0

, table_prefix , FROM.

- ? ? , : -s

+5
1

, , , , , (, 5-10, 100).

FranceUser SpainUser .. , . login/register/etc, . , . , , , .

, , , . , , , , .

:)

0

All Articles