<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Yup Dot Com: No Reservations about Keywords in Ruby on Rails</title>
    <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Advanced Web Services</description>
    <item>
      <title>No Reservations about Keywords in Ruby on Rails</title>
      <description>&lt;p&gt;&lt;img src="http://farm1.static.flickr.com/66/164496756_e8f8a16a87_m.jpg" style="margin: 4px; padding: 4px; float: right; border: 1px dotted #ccc;" alt="Thesaurus" /&gt;&lt;/p&gt;

&lt;p&gt;Have you ever had the urge to name a data model in your Ruby on Rails application something obvious, like Action, Table, File, Columns, or Database? Well, don&amp;#8217;t. Choosing a name like that might work for you in some cases, but it might fail miserably for someone else using a different database engine (i.e., MySQL verses PostgreSQL verses Oracle). &lt;/p&gt;

&lt;p&gt;Think you can remember all the problematic names? Think again. There are at least 974 known keywords which can give you problems. I started with the &lt;a href="http://wiki.rubyonrails.com/rails/pages/ReservedWords"&gt;ReservedWords&lt;/a&gt; pages on the Ruby on Rails Wiki, and pulled in and merged all the SQL-92, SQL-99, SQL-2003, PostgreSQL, MySQL, SQL Server and ODBC reserved keywords, and put them in one place, mainly for my own future reference.&lt;/p&gt;

&lt;p&gt;So what if your data models are about Databases, Tables, Columns, and Files? Simply think of a Good Prefix&amp;trade;, and name all your models accordingly: DaDatabase, DaTable, DaColumn, and DaFile, with resulting table named da_databases, da_tables, da_columns, and da_files. It&amp;#8217;s easy, painless, and helps you group similarly-purposed tables and models accordingly, and you don&amp;#8217;t have to wrack your brains thinking of synonyms for obvious model names like &amp;#8220;Action&amp;#8221;. I use Geo- for location-oriented data, Sys- for System-oriented tables, Log- for transactions, and App- for application-oriented tables.&lt;/p&gt;

&lt;p&gt;Read on to see the full list &amp;#8230; &lt;/p&gt;</description>
      <pubDate>Wed, 31 Jan 2007 16:05:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5b1515c6-c759-4a7a-9e4e-856732447d0b</guid>
      <author>Daniel Butler</author>
      <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails</link>
      <category>Ruby on Rails</category>
    </item>
    <item>
      <title>"No Reservations about Keywords in Ruby on Rails" by prl</title>
      <description>&lt;p&gt;thanks for collecting these I got shanked by this twice in one project by using link and attribute…I was hesitant to use a prefix at first…Mylink or whatever because I thought it would confuse rails when it pluralizes class files&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jul 2008 02:37:28 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:ff06dcfe-b128-4eac-bfbc-fe2eff183ab2</guid>
      <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails#comment-1011</link>
    </item>
    <item>
      <title>"No Reservations about Keywords in Ruby on Rails" by fsasf</title>
      <description>&lt;p&gt;thanks for collecting these I got shanked by this twice in one project by using link and attribute…I was hesitant to use a prefix at first…Mylink or whatever because I thought it would confuse rails when it pluralizes class files&lt;/p&gt;</description>
      <pubDate>Tue, 20 May 2008 04:11:27 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d8393599-5a79-4016-9e67-4acbbfba5f34</guid>
      <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails#comment-1007</link>
    </item>
    <item>
      <title>"No Reservations about Keywords in Ruby on Rails" by rssnewsdigest</title>
      <description>&lt;p&gt;Try rssnewsdigest.com, a new comprehensive news aggregator. With rssnewsdigest, you don ’t really have to go anywhere else.
    &lt;a href="http://rssnewsdigest.com"&gt;http://rssnewsdigest.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 03 Apr 2008 08:57:05 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:a8396d30-0c6e-4959-9e5d-0ae773934eb4</guid>
      <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails#comment-1003</link>
    </item>
    <item>
      <title>"No Reservations about Keywords in Ruby on Rails" by tj</title>
      <description>&lt;p&gt;thanks for collecting these I got shanked by this twice in one project by using link and attribute&amp;#8230;I was hesitant to use a prefix at first&amp;#8230;Mylink or whatever because I thought it would confuse rails when it pluralizes class files&lt;/p&gt;</description>
      <pubDate>Tue, 20 Feb 2007 19:01:13 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1ce124bd-cd43-4e8a-a608-1a263dd70731</guid>
      <link>http://www.yup.com/articles/2007/01/31/no-reservations-about-keywords-in-ruby-on-rails#comment-329</link>
    </item>
  </channel>
</rss>
