class ActiveAdmin::DatabaseHitDuringLoad

Public Class Methods

capture() { || ... } click to toggle source
# File lib/active_admin/error.rb, line 40
def self.capture
  yield
rescue *database_error_classes => exception
  raise new exception
end
new(exception) click to toggle source
Calls superclass method
# File lib/active_admin/error.rb, line 30
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. " +
        "One solution can be, to wrap the query in a Proc. " +
        "Original error message: #{exception.message}"
end

Private Class Methods

database_error_classes() click to toggle source
# File lib/active_admin/error.rb, line 48
def self.database_error_classes
  @classes ||= []
end