aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-27 14:43:01 -0500
committerGitHub <noreply@github.com>2018-11-27 14:43:01 -0500
commitddaca7ccec208ee80652e696e001671fd6e735f9 (patch)
treeb9da5c640d7620bda396ff5cb667f4a999e3cde6 /activerecord/CHANGELOG.md
parente4aec40578ea0dd2944f97f1ad60cfbdf4b3a44d (diff)
parentd34c1fc3d64e51f9aeecfbffefd843e744dfbeac (diff)
downloadrails-ddaca7ccec208ee80652e696e001671fd6e735f9.tar.gz
rails-ddaca7ccec208ee80652e696e001671fd6e735f9.tar.bz2
rails-ddaca7ccec208ee80652e696e001671fd6e735f9.zip
Merge pull request #34528 from DmitryTsepelev/fix-ignored-attributes
Additional types of ResultSet should not contain keys of #attributes_to_define_after_schema_loads
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 13cc486e7f..9d7bfbcef1 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,32 @@
+* Cached columns_hash fields should be excluded from ResultSet#column_types
+
+ PR #34528 addresses the inconsistent behaviour when attribute is defined for an ignored column. The following test
+ was passing for SQLite and MySQL, but failed for PostgreSQL:
+
+ ```ruby
+ class DeveloperName < ActiveRecord::Type::String
+ def deserialize(value)
+ "Developer: #{value}"
+ end
+ end
+
+ class AttributedDeveloper < ActiveRecord::Base
+ self.table_name = "developers"
+
+ attribute :name, DeveloperName.new
+
+ self.ignored_columns += ["name"]
+ end
+
+ developer = AttributedDeveloper.create
+ developer.update_column :name, "name"
+
+ loaded_developer = AttributedDeveloper.where(id: developer.id).select("*").first
+ puts loaded_developer.name # should be "Developer: name" but it's just "name"
+ ```
+
+ *Dmitry Tsepelev*
+
* Make the implicit order column configurable.
When calling ordered finder methods such as +first+ or +last+ without an