Andy
2006-Jan-21 15:04 UTC
[Rails] Specifying which Oracle schema to use with ActiveRecord
We use Oracle in my company. I have access to 2 schemas (or tablespaces?) : 1.SAL 2.SALDATA I use tables from both schemas. How do i tell active record which schema to look in for the table i want??? I''ve just managed to convince the boss to switch from Java to Rails so this would be a arse if i couldnt use both schemas. Any help would be GREATELY appreciated! Thanks, Chris -- Posted via http://www.ruby-forum.com/.
Andy
2006-Jan-21 15:29 UTC
[Rails] Re: Specifying which Oracle schema to use with ActiveRecord
so for example i might have table SAL.customers and table SALDATA.accounts. How do i tell active record which table to use? -- Posted via http://www.ruby-forum.com/.
Michael Schoen
2006-Jan-23 05:33 UTC
[Rails] Re: Specifying which Oracle schema to use with ActiveRecord
Andy wrote:> so for example i might have table SAL.customers and table > SALDATA.accounts. How do i tell active record which table to use?Use #set_table_name (or #table_name=) and include the schema name. So, something like: class Account < ActiveRecord::Base set_table_name "saldata.accounts" ... end