We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ignored_columns
1 parent 8d88cb6 commit 533eacfCopy full SHA for 533eacf
README.adoc
@@ -408,6 +408,21 @@ class Transaction < ActiveRecord::Base
408
end
409
----
410
411
+=== Always append to `ignored_columns` [[append-ignored-columns]]
412
+
413
+Avoid setting `ignored_columns`. It may overwrite previous assignments and that is almost always a mistake. Prefer appending to the list instead.
414
415
+[source,ruby]
416
+----
417
+class Transaction < ActiveRecord::Base
418
+ # bad - it may overwrite previous assignments
419
+ self.ignored_columns = %i[legacy]
420
+ # good - the value is appended to the list
421
+ self.ignored_columns += %i[legacy]
422
+ ...
423
+end
424
425
426
=== Enums [[enums]]
427
428
Prefer using the hash syntax for `enum`. Array makes the database values implicit
0 commit comments