Skip to content

generate model vs generate scaffold: wrong singularization for 'data' in rails 3.2.5? #6746

@fredrated

Description

@fredrated

In my application I have a table named 'tc_data'. In the original creation of my (first) rails application I used 'rails generate scaffold tc_data field_list_here...'.
'rake db:migrate' resulted in: TABLE NAME 'tc_data', MODEL NAME TcDatum, MODEL FILE NAME tc_datum.rb.
As I hone my application toward it's beta release I rebuilt it and decided to use 'rails generate model tc_data field_list_here' since this table is used by the application but does not need web interface access.
'rake db:migrate' resulted in: TABLE NAME 'tc_data', MODEL NAME TcData, MODEL FILE NAME tc_data.rb.

I am using postgreSQL as my database engine.

It would seem that there is a code difference between 'generate scaffold' and 'generate model' in generating the table and model names.

Since this could cause a wrong convention-based reference to the table or model, I will recreate the table using 'rails generate scaffold'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions