Hi, I guess this is a question for the Rails devs more than anyone else. What was your reason for using tables and not class names in the model view? eg: (TABLE) has_many :line_items (CLASS) has_many :LineItems I don''t wanna start an evil flame war that brings on a subtle Armageddon (;)) just curious. Julian.
On 8/28/05, Julian Leviston <julian-62HJldmB3ajk1uMJSBkQmQ@public.gmane.org> wrote:> Hi, > > I guess this is a question for the Rails devs more than anyone else. > What was your reason for using tables and not class names in the > model view? > eg: > (TABLE) has_many :line_items > (CLASS) has_many :LineItems > I don''t wanna start an evil flame war that brings on a subtle > Armageddon (;)) just curious.Well, for one, the class name should be LineItem. So that would be: has_many :LineItem which, imo, isn''t as good as has_many :line_items Joe
On Monday 29 August 2005 05:30, Julian Leviston wrote:> I guess this is a question for the Rails devs more than anyone else. > What was your reason for using tables and not class names in the > model view? > eg: > (TABLE) has_many :line_items > (CLASS) has_many :LineItemsYou''re confusing class/table names with the names of associations. The symbol names the association, which makes perfect sense considering the possibility of having more than one association to the same class/table. class Company has_many :employees # here the class is derived from the name belongs_to :ceo, :class_name => Employee belongs_to :janitor, :class_name => Employee end Michael -- Michael Schuerig The Fifth Rider of the Apocalypse mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org is a programmer. http://www.schuerig.de/michael/