Superclass for all database execution errors.

Wraps the underlying database error as cause.

Methods

Attributes

[R] binds
[R] sql

Class Public methods

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

📝 Source code
# File activerecord/lib/active_record/errors.rb, line 184
    def initialize(message = nil, sql: nil, binds: nil, connection_pool: nil)
      super(message || $!&.message, connection_pool: connection_pool)
      @sql = sql
      @binds = binds
    end
🔎 See on GitHub

Instance Public methods

set_query(sql, binds)

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

      self
    end
🔎 See on GitHub