From ee044ea5477b4af41d2c0cebb13e47600da7493a Mon Sep 17 00:00:00 2001 From: Alexander Uvarov Date: Thu, 23 Jun 2011 23:06:52 +0600 Subject: Follow rails convention by using Array.wrap --- activemodel/lib/active_model/mass_assignment_security.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/mass_assignment_security.rb b/activemodel/lib/active_model/mass_assignment_security.rb index ff8732a33e..c04de5b9a4 100644 --- a/activemodel/lib/active_model/mass_assignment_security.rb +++ b/activemodel/lib/active_model/mass_assignment_security.rb @@ -1,5 +1,6 @@ require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/string/inflections' +require 'active_support/core_ext/array/wrap' require 'active_model/mass_assignment_security/permission_set' require 'active_model/mass_assignment_security/sanitizer' @@ -112,7 +113,7 @@ module ActiveModel self._protected_attributes = protected_attributes_configs.dup - Array(role).each do |name| + Array.wrap(role).each do |name| self._protected_attributes[name] = self.protected_attributes(name) + args end @@ -174,7 +175,7 @@ module ActiveModel self._accessible_attributes = accessible_attributes_configs.dup - Array(role).each do |name| + Array.wrap(role).each do |name| self._accessible_attributes[name] = self.accessible_attributes(name) + args end -- cgit v1.2.3