lib/brakeman/checks/check_mass_assignment.rb in brakeman-1.6.0 vs lib/brakeman/checks/check_mass_assignment.rb in brakeman-1.6.1
- old
+ new
@@ -12,11 +12,11 @@
def run_check
return if mass_assign_disabled?
models = []
tracker.models.each do |name, m|
- if parent?(m, :"ActiveRecord::Base") and m[:attr_accessible].nil?
+ if unprotected_model? m
models << name
end
end
return if models.empty?
@@ -66,10 +66,9 @@
end
warn :result => res,
:warning_type => "Mass Assignment",
:message => "Unprotected mass assignment",
- :line => call.line,
:code => call,
:user_input => user_input,
:confidence => confidence
end