This repository has been archived by the owner. It is now read-only.
Browse files

return empty hash when no params given

  • Loading branch information...
Ivan Navarrete and Jonas Nicklas
Ivan Navarrete and Jonas Nicklas committed Mar 20, 2012
1 parent 59baa3b commit 08cc4ce2e4cf015a6883af0e3d55377769d4d8a8
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/trusted_attributes.rb
@@ -37,6 +37,7 @@ def trust(*attributes)
def attributes
+ return {} unless params[attributes_key]
# Be helpful and raise an exception when non trusted attributes are sent
unless Rails.env.production?
diff = params[attributes_key] - accessible_attributes

0 comments on commit 08cc4ce

Please sign in to comment.