# File lib/brakeman/checks/check_unscoped_find.rb, line 9 def run_check Brakeman.debug("Finding instances of #find on models with associations") associated_model_names = active_record_models.keys.select do |name| if belongs_to = active_record_models[name].associations[:belongs_to] not optional_belongs_to? belongs_to else false end end calls = tracker.find_call :method => [:find, :find_by_id, :find_by_id!], :targets => associated_model_names calls.each do |call| process_result call end end