From: Carl Youngblood Date: 2004-07-11T13:07:08+09:00 Subject: Re: ActiveRecord comments To clarify my thinking on this one, I am suggesting that the pluralize_table_names option should only change the way ActiveRecord should look for table names and everything else should be unchanged. Changing this option should not require the associations to be declared differently. On Sat, 10 Jul 2004 21:03:27 -0700, Carl Youngblood wrote: > I'm trying out ActiveRecord for the first time and I have a question/suggestion: > > I prefer not to pluralize my table names; it's pretty obvious that > they are going to hold more than one row, so why bother? So, in > ActiveRecord, I chose to turn off the default behavior with: > > ActiveRecord::Base.pluralize_table_names = false > > However, this makes it so I can't declare my objects' associations in > an intuitive way. For example, in the following code: > > class Email < ActiveRecord::Base > has_and_belongs_to_many :user > end > > I can no longer say has_and_belongs_to_many :users. I have to say > has_and_belongs_to_many :user. When adding multiple associations, I > also can't say someuser.add_emails. I have to say someuser.add_email, > even when I am adding more than one. Why can't I keep my table names > singular and yet refer to my associations in plural form? Since > ActiveRecord already understands plurals, it should be able to reverse > the process as well. > > Regardless, it is a great tool that I'm sure will be mighty handy. > > Thanks, > > Carl Youngblood >