On 18 May 2011 15:37, fredrated <[email protected]> wrote: > According to 'Agile web development with rails' "... a model is > automatically mapped to a database table whose name is the plural form > of the model's class". Sure enough, when I created migrations for > 'Tc_project', 'Tc_employee' and 'Tc_period' the migration files issue > a 'create table' with the table names pluralized. However, when I > issue "Rails generate scaffold Tc_data..." the create table statement > in the migration DID NOT pluralize 'tc_data' to 'tc_datas'! > > Does anyone know if this will create a 'convention' problem between > model and table references for the table 'Tc_data'? > Unless I hear otherwise I will assume Rails knows what it is doing and > run the migration as-is and proceed as if nothing is out of the > ordinary. If Rails chokes on this I will post a reply to my own > question.
As Tim has pointed out, this should be datum for the singular and data for the plural. I would also point out that you will make life easier for yourself if you stick to the Rails conventions for capitalisation and underscores. In this case the class would be something like TcDatum and the table tc_data (or something completely different if you do not like datum). Similarly I would change the names of the other classes you mention. Colin Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

