Ok Andrew,<br><br>I thought I had to configure it in each class model! But how do you use migrations in your environment without messing up with the Mambo's tables?<br><br>Thanks again<br><br><div class="gmail_quote">On Fri, Jan 8, 2010 at 11:57 AM, Andrew Stewart <span dir="ltr"><<a href="mailto:boss@airbladesoftware.com">boss@airbladesoftware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
On 8 Jan 2010, at 11:52, Riccardo Tacconi wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If I use :table_name_prefix => "rails_" I suppose that a table rails_teams will be defined in Rails as teams, isn't it? Otherwise I cannot see the utility.<br>
</blockquote>
<br></div>
That's right.  In your config/environment.rb you would add:<br>
<br>
    config.active_record.table_name_prefix = 'rails_'<br>
<br>
Then your Team model would map to the table rails_teams.  Once the prefix is configured you forget all about it in your code.  For example, if you wanted to add a column later on via a migration, you would do:<br>
<br>
    add_column :teams, :name, :string<br>
<br>
...and not `add_column :rails_teams ...`<div><div></div><div class="h5"><br>
<br>
Regards,<br>
<br>
Andy Stewart<br>
-------<br>
<a href="http://airbladesoftware.com" target="_blank">http://airbladesoftware.com</a><br>
<br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Tacconi<br>VIRTUELOGIC LIMITED<br><br><a href="http://www.linkedin.com/in/riccardotacconi">http://www.linkedin.com/in/riccardotacconi</a><br><a href="http://riccardotacconi.blogspot.com/">http://riccardotacconi.blogspot.com/</a><br>
<a href="http://twitter.com/rtacconi">http://twitter.com/rtacconi</a><br>Linux user: #400461<br>