diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-11-15 19:55:47 -0500 |
---|---|---|
committer | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-11-22 13:53:23 -0500 |
commit | 192b7bcfacd550312b37e74d858b63b77d2469d5 (patch) | |
tree | 553569b30ced5a658e5896c3edc730071f1c95fe /activerecord/CHANGELOG.md | |
parent | 47ab6b36d794e68e76dcb45463c0d2a5bdba2104 (diff) | |
download | rails-192b7bcfacd550312b37e74d858b63b77d2469d5.tar.gz rails-192b7bcfacd550312b37e74d858b63b77d2469d5.tar.bz2 rails-192b7bcfacd550312b37e74d858b63b77d2469d5.zip |
Redact SQL in errors
Move `ActiveRecord::StatementInvalid` SQL to error property.
Also add bindings as an error property.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 2a237f86cf..24a64e9deb 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,23 @@ +* Move `ActiveRecord::StatementInvalid` SQL to error property and include binds as separate error property. + + `ActiveRecord::ConnectionAdapters::AbstractAdapter#translate_exception_class` now requires `binds` to be passed as the last argument. + + `ActiveRecord::ConnectionAdapters::AbstractAdapter#translate_exception` now requires `message`, `sql`, and `binds` to be passed as keyword arguments. + + Subclasses of `ActiveRecord::StatementInvalid` must now provide `sql:` and `binds:` arguments to `super`. + + Example: + + ``` + class MySubclassedError < ActiveRecord::StatementInvalid + def initialize(message, sql:, binds:) + super(message, sql: sql, binds: binds) + end + end + ``` + + *Gannon McGibbon* + * Add an `:if_not_exists` option to `create_table`. Example: |