Exception: ActiveRecord::StatementInvalid

Inherits:
ActiveRecordError show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/errors.rb

Overview

Superclass for all database execution errors.

Wraps the underlying database error as cause.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, sql: nil, binds: nil) ⇒ StatementInvalid

Returns a new instance of StatementInvalid.



159
160
161
162
163
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/errors.rb', line 159

def initialize(message = nil, sql: nil, binds: nil)
  super(message || $!&.message)
  @sql = sql
  @binds = binds
end

Instance Attribute Details

#bindsObject (readonly)

Returns the value of attribute binds.



165
166
167
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/errors.rb', line 165

def binds
  @binds
end

#sqlObject (readonly)

Returns the value of attribute sql.



165
166
167
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/errors.rb', line 165

def sql
  @sql
end