class ActiveRecord::StatementInvalid

Parent:
ActiveRecord::ActiveRecordError

Superclass for all database execution errors.

Wraps the underlying database error as cause.

Public Class Methods

new(message = nil, original_exception = nil) Show source
# File activerecord/lib/active_record/errors.rb, line 100
def initialize(message = nil, original_exception = nil)
  if original_exception
    ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. "                                          "Exceptions will automatically capture the original exception.", caller)
  end

  super(message || $!.try(:message))
end
Calls superclass method

Public Instance Methods

original_exception() Show source
# File activerecord/lib/active_record/errors.rb, line 109
def original_exception
  ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
  cause
end

© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.