From 4739a1b9a33a919593fa8b9df644e527fa3c0ef9 Mon Sep 17 00:00:00 2001 From: Joel Van Horn Date: Sat, 2 Jul 2011 19:36:55 -0400 Subject: [PATCH] updated param_* method signatures to be the same as attr_* methods, accepting a list of property names instead of an array, followed by an options hash --- lib/param_protected/controller_modifications.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/param_protected/controller_modifications.rb b/lib/param_protected/controller_modifications.rb index d72194d..c0c3fb0 100644 --- a/lib/param_protected/controller_modifications.rb +++ b/lib/param_protected/controller_modifications.rb @@ -12,11 +12,13 @@ def self.extended(action_controller) module ClassMethods - def param_protected(params, actions = nil) + def param_protected(*params) + actions = params.extract_options! Protector.instance(self).declare_protection(params, actions, BLACKLIST) end - def param_accessible(params, actions = nil) + def param_accessible(*params) + actions = params.extract_options! Protector.instance(self).declare_protection(params, actions, WHITELIST) end