method

table_exists?

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 1 note - Class: ActiveRecord::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.1.0) is shown here.

These similar methods exist in v7.1.3.2:

table_exists?() public

Indicates whether the table associated with this class exists

Show source
Register or log in to add new notes.
March 11, 2009
2 thanks

Use table_exists? in initializers

When using ActiveRecords in initializers, eg. for creating small constant data on startup, use table_exists? for those statements.

the initalizers are also called for migrations, etc, and if you are installing a new instance of the project these initializers will fail the migration to create those tables in the first place.