Skip to content

Problem creating separate tables for admin #50

Answered by janko
holdenhinkle asked this question in Q&A
Discussion options

You must be logged in to vote

For table name configuration methods I typically open the corresponding feature documentation and search for the term "table". In your case, the correct configuration would be:

reset_password_table :admin_account_password_reset_keys
verify_account_table :admin_account_verification_keys
verify_login_change_table :admin_account_login_change_keys
remember_table :admin_account_remember_keys

Note that in your case all table names are the default table names prefixed with admin_*, so you could DRY up the logic to make it work for any future features as well:

methods.grep(/_table$/) do |table_method|
  public_send(table_method) { :"admin_#{super()}" }
end

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@holdenhinkle
Comment options

Answer selected by holdenhinkle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants