Exception: ActiveRecord::StatementInvalid
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::StatementInvalid
- Defined in:
- lib/active_record/errors.rb
Overview
Superclass for all database execution errors.
Wraps the underlying database error as cause
.
Direct Known Subclasses
LockWaitTimeout, MismatchedForeignKey, NoDatabaseError, NotNullViolation, PreparedStatementCacheExpired, QueryCanceled, RangeError, StatementTimeout, TransactionRollbackError, ValueTooLong, WrappedDatabaseException
Instance Attribute Summary collapse
-
#binds ⇒ Object
readonly
Returns the value of attribute binds.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Instance Method Summary collapse
-
#initialize(message = nil, sql: nil, binds: nil) ⇒ StatementInvalid
constructor
A new instance of StatementInvalid.
Constructor Details
#initialize(message = nil, sql: nil, binds: nil) ⇒ StatementInvalid
Returns a new instance of StatementInvalid.
104 105 106 107 108 |
# File 'lib/active_record/errors.rb', line 104 def initialize( = nil, sql: nil, binds: nil) super( || $!.try(:message)) @sql = sql @binds = binds end |
Instance Attribute Details
#binds ⇒ Object (readonly)
Returns the value of attribute binds.
110 111 112 |
# File 'lib/active_record/errors.rb', line 110 def binds @binds end |
#sql ⇒ Object (readonly)
Returns the value of attribute sql.
110 111 112 |
# File 'lib/active_record/errors.rb', line 110 def sql @sql end |