Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Reserved Class Names

I tried creating a model called "class" (as in a graduating class of students), and encountered all kinds of problems. What are some other words or class names to avoid in Rails?

Some links I've found:
http://juicebar.wordpress.com/2007/05/30/reserved-words-in-rails/
http://railsforum.com/viewtopic.php?id=22242

like image 499
GeekJock Avatar asked Mar 29 '09 04:03

GeekJock


1 Answers

This page has a very long list of words not to use:

https://reservedwords.herokuapp.com/words

Because 'class' comes up very commonly as a name with metaprogamming, I think the accepted ruby alternative is 'klass'. This is obviously a different context from your graduating class situation, but maybe still helpful.

like image 64
Angela Avatar answered Sep 28 '22 11:09

Angela