From decafbd9cf22c8e17e6b3545b852225dfb064992 Mon Sep 17 00:00:00 2001 From: Tom Hallett Date: Tue, 30 Aug 2022 10:23:13 -0400 Subject: [PATCH] Docs: Example should append to ignored_columns Updating the documentation for setting `self.ignored_columns` on an ActiveRecord model to append to the existing value instead of overwriting the existing array. Appending to the existing value, `+=`, is helpful for the scenario when 2 developers set `ignored_columns` in different parts of the file and the second one overwrites the first one. --- activerecord/lib/active_record/model_schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index 0dc32c5c6823f..cd0afd56bdd7e 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -341,7 +341,7 @@ def ignored_columns # # name :string, limit: 255 # # category :string, limit: 255 # - # self.ignored_columns = [:category] + # self.ignored_columns += [:category] # end # # The schema still contains "category", but now the model omits it, so any meta-driven code or