I am changing the table_name_prefix
during running of a rails application (might sound weird, but really that's what I want). When the table_name_prefix
changes for the ActiveRecord
I reset the table names (table_name
and quoted_table_name
) by calling reset_table_name
, and they change.. however I have another issue.
If the table name changes, after calling such a thing like count or a find the ActiveRecord object still operates with the table, which was used before.
How can reach to reset an ActiveRecord
descendant, so that when the prefix, suffix, table_name changes it works with the new settings?
Thanks for your help!