Skip to content

Files

Latest commit

 

History

History
27 lines (19 loc) · 725 Bytes

Rails-UnusedIgnoredColumns.md

File metadata and controls

27 lines (19 loc) · 725 Bytes

Pattern: Unused column in ignored_columns

Issue: -

Description

Suggests you remove a column that does not exist in the schema from ignored_columns. ignored_columns is necessary to drop a column from RDBMS, but you don't need it after the migration to drop the column. You avoid forgetting to remove ignored_columns by this rule.

Examples

# bad
class User < ApplicationRecord
  self.ignored_columns = [:already_removed_column]
end

# good
class User < ApplicationRecord
  self.ignored_columns = [:still_existing_column]
end

Further Reading