Exception: ActiveAdmin::DatabaseHitDuringLoad

Inherits:
ErrorLoading show all
Defined in:
lib/active_admin/error.rb

Instance Method Summary collapse

Methods inherited from ErrorLoading

#find_cause

Constructor Details

#initialize(exception) ⇒ DatabaseHitDuringLoad

Returns a new instance of DatabaseHitDuringLoad.



13
14
15
16
17
18
19
20
# File 'lib/active_admin/error.rb', line 13

def initialize(exception)
  file, line = find_cause(:app, exception.backtrace)

  super "Your file, #{file} (line #{line}), caused a database error while Active Admin was loading. This " +
        "is most common when your database is missing or doesn't have the latest migrations applied. To " +
        "prevent this error, move the code to a place where it will only be run when a page is rendered. " +
        "Original error message: #{exception.message}"
end