I am new to ruby I tried the following connecting to an Oracle XE instance. CREATE TABLE test ( id NUMBER(10) NOT NULL, title VARCHAR2(60), author NUMBER(20), PRIMARY KEY (id) ); CREATE SEQUENCE test_seq; Set the following in \config\environment.rb ActiveRecord::Base.pluralize_table_names = false Set the database connection in \config\database.yml Ran ruby script/generate scaffold Test Ran ruby script/server Everything worked fine Repeated the above with the table name and sequence name set to recipie and got the error uninitialized constant Recipy Is this anything to do with pluralisation and table name ending in IE? -- 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 -~----------~----~----~----~------~----~------~--~---
You could try it spelled as ''recipe'' and see what you get. On 9/12/06, Paul Flynn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am new to ruby I tried the following connecting to an Oracle XE > instance. > > CREATE TABLE test ( > id NUMBER(10) NOT NULL, > title VARCHAR2(60), > author NUMBER(20), > PRIMARY KEY (id) > ); > > CREATE SEQUENCE test_seq; > > Set the following in \config\environment.rb > ActiveRecord::Base.pluralize_table_names = false > > Set the database connection in \config\database.yml > > Ran ruby script/generate scaffold Test > > Ran ruby script/server > > Everything worked fine > > Repeated the above with the table name and sequence name set to recipie > > and got the error > > uninitialized constant Recipy > > Is this anything to do with pluralisation and table name ending in IE? > > -- > Posted via http://www.ruby-forum.com/. > > > >-- - Nic --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nic Werner wrote:> You could try it spelled as ''recipe'' and see what you get. > > On 9/12/06, Paul Flynn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > - NicThanks Nic Whilst I acknowledge my dyslexia!! The fundamental problem is still there, change my misspelling of recipie with what I am to Ruby... newbie and you get the same result. Therefore the original question is still valid what happens when table names end in IE. -- 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 -~----------~----~----~----~------~----~------~--~---
Paul Flynn <rails-mailing-list@...> writes:> Thanks Nic > > Whilst I acknowledge my dyslexia!! The fundamental problem is still > there, change my misspelling of recipie with what I am to Ruby... newbie > and you get the same result. Therefore the original question is still > valid what happens when table names end in IE. >There are 2 possibilities. The first is to tell Rails how to pluralise ''newbie'' correctly in your environment.rb (it has comments telling you how) The second is to use set_table_name in your model to explicitely tell Rails which table to use for it (documentation has all the gossip about that function) Don''t worry, Rails is plenty flexible enough in that area Gareth --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Right, at the top of your class definition (model file) add: set_table_name "recipes". In my example, I assume the name of your table in the Oracle database is ''recipes''. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---