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 73b9c68 commit 420937fCopy full SHA for 420937f
README.adoc
@@ -404,6 +404,22 @@ class Transaction < ApplicationRecord
404
end
405
----
406
407
+=== Always append to `ignored_columns` [[append-ignored-columns]]
408
+
409
+Avoid setting `ignored_columns`. It may overwrite previous assignments and that is almost always a mistake. Prefer appending to the list instead.
410
411
+[source,ruby]
412
+----
413
+class Transaction < ApplicationRecord
414
+ # bad - it may overwrite previous assignments
415
+ self.ignored_columns = %i[legacy]
416
417
+ # good - the value is appended to the list
418
+ self.ignored_columns += %i[legacy]
419
+ ...
420
+end
421
422
423
=== Enums [[enums]]
424
425
Prefer using the hash syntax for `enum`. Array makes the database values implicit
0 commit comments