Skip to content
Browse files

Follow rails convention by using Array.wrap

  • Loading branch information...
1 parent 52302f0 commit 79956db91c2ae7aacaf7b1ed5df7fe57f6f3c9d7 @wildchild wildchild committed Jun 23, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 activemodel/lib/active_model/mass_assignment_security.rb
View
5 activemodel/lib/active_model/mass_assignment_security.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/class/attribute.rb'
+require 'active_support/core_ext/array/wrap'
require 'active_model/mass_assignment_security/permission_set'
module ActiveModel
@@ -97,7 +98,7 @@ def attr_protected(*args)
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
@@ -159,7 +160,7 @@ def attr_accessible(*args)
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

0 comments on commit 79956db

Please sign in to comment.
Something went wrong with that request. Please try again.