class ActiveRecord::StatementInvalid
Superclass for all database execution errors.
Wraps the underlying database error as cause
.
Inherits From
Attributes
[R] | binds |
|
[R] | sql |
Public class methods
Source code GitHub
# File activerecord/lib/active_record/errors.rb, line 205
def initialize(message = nil, sql: nil, binds: nil, connection_pool: nil)
super(message || $!&.message, connection_pool: connection_pool)
@sql = sql
@binds = binds
end
Public instance methods
Source code GitHub
# File activerecord/lib/active_record/errors.rb, line 213
def set_query(sql, binds)
unless @sql
@sql = sql
@binds = binds
end
self
end