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 f0d5006Copy full SHA for f0d5006
README.adoc
@@ -404,6 +404,21 @@ 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 < ActiveRecord::Base
414
+ # bad - it may overwrite previous assignments
415
+ self.ignored_columns = %i[legacy]
416
+ # good - the value is appended to the list
417
+ self.ignored_columns += %i[legacy]
418
+ ...
419
+end
420
421
422
=== Enums [[enums]]
423
424
Prefer using the hash syntax for `enum`. Array makes the database values implicit
0 commit comments