Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ErrorResultSnapshot
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb |
Class Method Summary
- .new(result) ⇒ ErrorResultSnapshot constructor
Instance Attribute Summary
- #error_message (also: #result_error_message) readonly
-
#result_error_message
readonly
Alias for #error_message.
Instance Method Summary
- #error_field(field) (also: #result_error_field)
-
#result_error_field(field)
Alias for #error_field.
Constructor Details
.new(result) ⇒ ErrorResultSnapshot
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 337
def initialize(result) @fields = PG.constants. grep(/\APG_DIAG_/). map { PG.const_get(_1) }. index_with { result.error_field(_1) } @error_message = result. end
Instance Attribute Details
#error_message (readonly) Also known as: #result_error_message
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 351
attr_reader :
#result_error_message (readonly)
Alias for #error_message.
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 352
alias : :
Instance Method Details
#error_field(field) Also known as: #result_error_field
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 346
def error_field(field) @fields[field] end
#result_error_field(field)
Alias for #error_field.
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 349
alias :result_error_field :error_field