Browse files

Ruby 1.9.2: prefer Array.wrap to [foo].flatten

  • Loading branch information...
1 parent f62a883 commit 2d67ef941670c99d1c02d91a22f24b8d31467884 @jeremy jeremy committed Nov 13, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/active_record_helper.rb
View
2 actionpack/lib/action_view/helpers/active_record_helper.rb
@@ -171,7 +171,7 @@ def error_messages_for(*params)
options = params.extract_options!.symbolize_keys
if object = options.delete(:object)
- objects = [object].flatten
+ objects = Array.wrap(object)
else
objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact
end

0 comments on commit 2d67ef9

Please sign in to comment.