In the subject line you indicate that problem is specific to using the
word 'record' with belongs_to. Is that correct? In other words do
you get the same error with belongs_to :foo, .....
It may well be a reserved word in other situations also.
Unfortunately I do not know of any up to date reserved word list at
all. There was a list in wiki.rubyonrails.org but the wiki
disappeared a long time ago. Googling has not found anything up to
date.
I scraped the Rails Wiki before it went entirely away, and I also found another list somewhere (maybe StackOverflow) and merged the two. Only two people ever signed up to add more words, so it kind of died on the vine. If you want to contribute, you are certainly welcome to do so.
Am I the only one to be continually embarrassed when google turns up
results showing that I should have known the answer already? It
appears that it was my suggestion that you started that list. [1]
I have made sure to bookmark the url now and if I find a new one will update it.
Could I suggest you make the title "Reserved Words in Ruby on Rails"
as my initial search included the word ruby so yours did not turn up.
I usually include ruby when searching for rails as it reduces the
number of rolling stock hits.
'record' is often a reserved word in the underlying dbms, but I was pretty sure Rails (AR) protected this such as surrounding field names and other identifiers with back ticks. Not sure if other dbmses do this or not….