v1.0.0 - Show latest stable - 1 note - Class: ActiveRecord::Base
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.