Skip to Content Skip to Search

Superclass for all database execution errors.

Wraps the underlying database error as cause.

Methods
N
S

Attributes

[R] binds
[R] sql

Class Public methods

new(message = nil, sql: nil, binds: nil)

# File activerecord/lib/active_record/errors.rb, line 162
def initialize(message = nil, sql: nil, binds: nil)
  super(message || $!&.message)
  @sql = sql
  @binds = binds
end

Instance Public methods

set_query(sql, binds)

# File activerecord/lib/active_record/errors.rb, line 170
def set_query(sql, binds)
  unless @sql
    @sql = sql
    @binds = binds
  end

  self
end