Re: A table named references

John Woods
2009-06-25T21:27:51Z

Thanks so much. I wish there was some kind of protection against
creating scaffolds with reserved words. It''s frustrating.

Anyway, thank you for the help!

On Jun 25, 4:26 am, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:
> 2009/6/24 John Woods
<john.wo...-+ksaPUZU+wsI+954vlgkHg@public.gmane.org>:
>
>
>
> > Hi all,
>
> > I accidentally generated a scaffold called reference, not realizing
> >referenceswas apparently a reserved word in MySQL. I thought I could
> > get away with it, since the scaffold itself seemed to be working, but
> > now I''m getting an error that suggests Rails doesn''t
like this
> > scaffold name.
>
> > I''d like to rename it to ref. Is it as simple as a
search-replace, or
> > will I encounter other problems? What''s the easiest solution?
>
> It should be as simple as changing all uses of the text
''reference'' to
> ''ref'' and ''Reference'' to
''Ref'' plus renaming the files and folders.
> That is assuming you have not used the text ''reference''
anywhere else
> of course.   I would advise committing to your source control system
> first and then if it is a disaster for some unforeseen reason you can
> just revert.
>
> Colin