List of reserved words in rails *3*

2019-03-12 17:08发布

问题:

Is there a good, authoritative list of reserved words for RAILS-3?

Candidates:

  • http://oldwiki.rubyonrails.org/rails/pages/ReservedWords, but it seems a bit out of date and rails2.
  • http://cheat.errtheblog.com/s/rails_reserved_words (but there seems no authority to this - it could just grow and grow...)
  • http://latheesh.com/2010/02/02/rails-reserved-words/

Background: I'm maintaining a long-serving rails app and it has plenty of usages of reserved words (judging that http://oldwiki.rubyonrails.org/rails/pages/ReservedWords seems to apply to rails2). However, none of these are actually interfering with current activity (the app works... and the specs&features I'm slowly adding to all pass). But as time passes I'd like to remove those usages of reserved words, but don't want to bother if some reserved words are no longer really reserved. So while a longer list might be good for NEW rails apps, I need stronger justification for budget spend than "it has been listed on a webpage at somepoint"...)

Maybe the nature of rails is that you can't find an authoritative list, but you can find "things that didn't work for me at some point"....

回答1:

This seems like a pretty comprehensive list. However, you are correct. The very nature of programming means that this list will be ever changing. However I will do some research...maybe there is a site that can list reserved words based on the version of Rails you are using. If not...maybe someone should get working on it :D



回答2:

Here's a good collaborative list of reserved words in Rails: https://reservedwords.herokuapp.com/