Hi, In My database there is a table called "categories". Now what name should I specify for my model as per ruby naming convention? Is it "Category"??? Also is it possible to keep database table name singular instead of plural? Please tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
Prashant Tiwari wrote:> Hi, > In My database there is a table called "categories". Now what name > should I specify for my model as per ruby naming convention? Is it > "Category"??? > Also is it possible to keep database table name singular instead of > plural? > Please tell me. > Thanx in advance. > PrashThe model would be called Category. Then in the model you can set the name using: set_table_name "category" Or if you want this for all models, put the following line in your environmen.rb: ActiveRecord::Base.pluralize_table_names = false Joey__ -- Posted via http://www.ruby-forum.com/.
Seemingly Similar Threads
- How to check for presence of particular value entered ?
- pls help me regarding Maths round up function.....
- How to find particular pattern in string?
- Can anybody tell me step by step how validate data on form?
- How to get difference between two dates in days???