Forum: Ruby on Rails just a feedback

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-02-02 19:10
(Received via mailing list)
Hello !

If you want to create models, views and controllers using the command
line "sudo ruby  ./script/generate scaffold book test"
and rails is plugged to an existing database which tables are named in
singular

Don't forget that Rails will search a table named "books" even if you
specify the table name "book" without "s".
Rails will return the error "Before updating scaffolding from new DB
schema, try creating a table for your mode"
Even if the name of the table is matching the name of the model
specified in the command line

If you want to deactivate this behaviour, in case of testing RoRs with
your existing database, you must add in your environment.rb file the
following variable :
ActiveRecord::Base.pluralize_table_names = false

HM
This topic is locked and can not be replied to.