lib/param_accessible/rules.rb in param_accessible-0.0.1 vs lib/param_accessible/rules.rb in param_accessible-0.0.2

- old
+ new

@@ -31,13 +31,12 @@ elsif value.is_a?(Hash) nested = accessible[key] || {} detect_inaccessible_hash value, nested, errors, prefix_for(prefix, key) elsif value.is_a?(Array) - nested = accessible[key] || {} - value.each do |v| + value.each_with_index do |v, i| if v.is_a?(Hash) - detect_inaccessible_hash v, nested, errors, prefix_for(prefix, key) + detect_inaccessible_hash v, accessible[key][i], errors, prefix_for(prefix_for(prefix, key), "") end end end end