Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def detect
(config(:ignore_columns_with_default) && (column.default || column.default_function)) ||

# Explicitly ignored columns should be skipped.
config(:ignore_attributes).include?("#{model.name}.#{column.name}")
ignored?("#{model.name}.#{column.name}", config(:ignore_attributes))
end

# At this point the only columns that are left are those that DO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ def test_config_ignore_attributes
refute_problems
end

def test_config_ignore_attributes_regexp
Context.create_table(:users) do |t|
t.string :name, null: false
end.define_model

config_file(<<-CONFIG)
ActiveRecordDoctor.configure do |config|
config.detector :missing_presence_validation,
ignore_attributes: [/name/]
end
CONFIG

refute_problems
end

def test_config_ignore_polymorphic_associations_via_relationship_name
Context.create_table(:comments) do |t|
t.references :commentable, null: false, polymorphic: true
Expand Down