activerecord - Rails 4 - switch/change table name during request dynamically? -


based on request, query either test_users or users. doing using user.table_name = "test_users" or user.table_name = "users"

this works in development, not in production (i.e table name in query not change), due -

config.cache_classes = true config.eager_load = true 

i guessing table names being cached somewhere , model.table_name= not update cache.

how can switch table name dynamically? running 4.2.0 , if helps postgres (pg gem).


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -