Class: WipeOut::Validators::DefinedRelations

Inherits:
Base
  • Object
show all
Defined in:
lib/wipe_out/validators/defined_relations.rb

Instance Method Summary collapse

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
# File 'lib/wipe_out/validators/defined_relations.rb', line 4

def call
  return if ignored?

  ar_class.reflect_on_all_associations.each do |relation|
    unless indirect_relation?(relation) || ignore_relation?(relation) || plan.relations[relation.name].present?
      result.add_error("#{ar_class.name} relation is missing: :#{relation.name}")
    end
  end
end