I have a problem with one Rails project and I can''t figure out why. I get the following error when any scaffold is generated: The name ''[model_name]'' is reserved by Ruby on Rails. So basically Rails complains that any model name I use is a reserved word. My model names are User, Invoice, InvoiceLineItem, Service and more....they aren''t reserved words. The only significant difference between this project and the other is the version of rails. This project is on edge. Has anyone had this happen before? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I just thought to run a trace and found our there is a class collision happening when generating a scaffold. Why would there be a class collision? I also found scaffolds can be generated for very simple models. However virtually any model that has a belongs_to relationship can''t have a scaffold generated. Just to simplyfy things I commented out all relationships from the models, but the scaffolds still can''t be generated. I think this happens because rails is actually looking at my database and not the model when generating the scaffold (how else would it kno whot to bind the HTML inputs?), and it spots "forgeign key" fields and chokes. Is this true? I''m new to rails and not sure exactly what I should do. Any suggestions? I know scaffolds aren''t the be-all-end-all but I was hoping to save some time by by using them as a starting point. My application is very CRUD-like and would only need minimal changes. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ok...just to keep anyone in the same boat updated.....I went through and deleted all foreign key columns in the database. I did this to force a really simple table/model. Generate scaffold still fails. Rails just doesn''t want to create scaffolds for the majority of my models. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Just to keep anyone in this same situation updated... Watch our for Observers and enerate Scaffold. If you have an Observer attached to any of your Models, Rails will throw a raise a class collission error if you try and generate a scaffold on that model. It''s not an obvious error and you''ll spend hours trying to figure out where the problem is. Solution: Remove your observer, genrerate the scaffold, add observer back in. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/3/06, Brandon Casci <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Just to keep anyone in this same situation updated... > > Watch our for Observers and enerate Scaffold. If you have an Observer > attached to any of your Models, Rails will throw a raise a class > collission error if you try and generate a scaffold on that model. > > It''s not an obvious error and you''ll spend hours trying to figure out > where the problem is. > > Solution: Remove your observer, genrerate the scaffold, add observer > back in.Great catch, Brandon. Would you open a ticket for this issue? http://dev.rubyonrails.org/newticket Thanks, jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---