Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
さまざまなドメインで動作する Rails 3 サイトがあり、モデルの 1 つで _set_table_name を使用して、要求されているドメインに基づいてテーブル名を動的に変更したいと考えています。これは可能ですか?
set_table_nameを支持して廃止予定ですtable_name=。これを使って:
set_table_name
table_name=
SomeModel.table_name = request.subdomain=='foo' ? 'foos' : 'bars'