title: How to create model for different databases?
body: <p>I just started learning ROR. And came across this DOUBT.<br/>
  I have defined multiple databases in my <strong>database.yml</strong> file like this:</p>
  
  <pre><code>development:
    adapter: mysql2
    encoding: utf8
    reconnect: true
    database: mydb1
    username: root
    password: root
    host: localhost
  
  custom:
    adapter: mysql2
    encoding: utf8
    reconnect: true
    database: customdb
    username: root
    password: root
    host: localhost
  </code></pre>
  
  <p>Now if I create a model using <code>rails generate model MyModel</code>, it will generate a migration to create table - <code>my_models</code> in <code>mydb1</code>.</p>
  
  <p>My question is <strong>"How can I create/specify a model, that to create a table under customdb?"</strong></p>
  
  <p>Do I need to change my rails environment or is there any other way? I am just curious. I can do this manually by creating a table in <code>customdb</code> and creating a model without migration.</p>