Forum: Ruby on Rails database tables

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.
C05b622476c66dc3901db6fe2b9fee0b?d=identicon&s=25 Raful Mr Mitchell H (Guest)
on 2006-02-28 16:54
(Received via mailing list)
I have been assigned a task of building a front end to a database that
has already been created.  All the database tables have the naming
convention of lclclcClclclc.  For example; tblComputerNames.  How do i
get around this in rails since it likes lower case table names to keep
with its naming conventions for classes and objects?

Mitch

Mitch Raful MCSE, CCNP
Network Engineer
MCCS Quantico
3044 Catlin Avenue
Quantico, VA 22134
67f61f0c385168c4b2e5b8fd733c397f?d=identicon&s=25 Christos Zisopoulos (Guest)
on 2006-02-28 17:01
(Received via mailing list)
Mitch,

Have a look at ActiveRecord::Base set_table_name over here:

http://api.rubyonrails.org/classes/ActiveRecord/Ba...

You might also want to look at set_primary_key also in
ActiveRecord::Base

-christos
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-02-28 17:04
(Received via mailing list)
Raful Mr Mitchell H wrote:
> I have been assigned a task of building a front end to a database that
> has already been created.  All the database tables have the naming
> convention of lclclcClclclc.  For example; tblComputerNames.  How do i
> get around this in rails since it likes lower case table names to keep
> with its naming conventions for classes and objects?
You can specify the individual table names in each model with
set_table_name...  I can't think of anything easier off the top of my
head, other than a custom generator for the model files.
This topic is locked and can not be replied to.