Hi, I have a database which have table named with different convention, It is not following rubyonrails convention that table name must be pural. How to create model for these table which will not follow convention. please help me regarding this -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Santosh R patil wrote:> Hi, > > I have a database which have table named with different convention, It > is not following rubyonrails convention that table name must be pural. > > How to create model for these table which will not follow convention. > > please help me regarding thisYou can create model with script/generate model. Then in model: class Foobar < ActiveRecord::Base set_table_name "no_conventional_table_name" set_primary_key "no_conventional_primary_key_id" # if needed end Regards! -- 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?hl=en -~----------~----~----~----~------~----~------~--~---