Getting table names

how to get table names from database like getting colum names

model.table_name()

I not sure if this works if you’ve overriden default by
set_table_name. It uses the default pluralization to guess.

-bakki

It does work if you’ve over ridden your default table name. We have a
legacy DB we connect to with a table named XXACD (among others):

Xxacd.table_name
=> “XXACD”

David

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs