Skip to content

"config.model" raises "table doesn't exist" exception if database is dropped #289

@krisleech

Description

@krisleech

initializers/rails_admin.rb

config.model Competition do
end

then

rake db:drop
rake db:create
rake db:migrate

In fact any rake task (which loads the environment) whic is run after dropping the database fails. This would appear to be because "config.model" needs to call Competition, I assume to get a list of database fields, and because the competitions table does not exist ActiveRecord raises an exception.

The solution I am using so far is to wrap the config.model block like so:

if defined? Competition
  config.model Competition
  end
end

Ruby 1.9.2
Rails 3.0.3
rails_admin HEAD

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions