aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorAlexander Uvarov <alexander.uvarov@gmail.com>2011-06-23 23:06:52 +0600
committerAlexander Uvarov <alexander.uvarov@gmail.com>2011-06-23 23:06:52 +0600
commitee044ea5477b4af41d2c0cebb13e47600da7493a (patch)
treeec80f64754c685936e85ad0b0a7ae9708d1db65f /activemodel
parent528f405cdc6195f0a872431fdcd2529729e27af8 (diff)
downloadrails-ee044ea5477b4af41d2c0cebb13e47600da7493a.tar.gz
rails-ee044ea5477b4af41d2c0cebb13e47600da7493a.tar.bz2
rails-ee044ea5477b4af41d2c0cebb13e47600da7493a.zip
Follow rails convention by using Array.wrap
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/mass_assignment_security.rb5
1 files changed, 3 insertions, 2 deletions
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