On Martes, 18 de Agosto de 2009 05:13:53 Faheem Merchant escribió: > I am creating a model called Equipment but when I check my database > the table name is called Equipment, I was expecting the plural to be > generated. Used the same method for all of my other models but they > were created in plural, is there something with the word Equipment > that is throwing off the table name to the singular instead of the > plural. Here is the command I used: > > ruby script/generate model Equipment exists:string date:date > location:references item:references state:reference
It's a rails issue,not ActiveScaffold, but I will answer anyway. # script/console 'equipment'.pluralize => "equipment" Rails has an exception in equipment in order to not pluralize , because equipment is uncountable, and uncountable names doesn't have plural form. You can change the table name in the migration and add a set_table_name in your model, or add a exception in you config/initializers/inflections.rb (better), although I think it's better leave it as equipment -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
