Reserved names with ActiveRecord models

at. picture at. · Dec 6, 2012 · Viewed 34k times · Source

I take naming pretty seriously, so I think pretty hard about good names for my ActiveRecord models. However, I frequently come up with a name and it has some conflict with a reserved name, either in the database or Ruby or Rails. Model or field names like set or group. Sometimes the issue isn't immediately apparent either. Is there a list somewhere of names we can't use in our model names and a list for field names?

Answer

Noz picture Noz · Dec 6, 2012

Here's a couple of resources to get you started:

  1. Rails reserved words. This one seems to be fairly up to date, last updated on Feb 2010. It even goes beyond rails and lists some common naming conflicts with SQL. dead
  2. Reserved words in rails. Here lives a heroku application featuring a searchable table of reserved rails words. The content on this one seems to be user-managed, so anybody with an account can add a new word.