From a98db7c6ef7384d60a1c7f02d43ee601e2647eea Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 27 Mar 2010 11:50:11 -0700 Subject: Use Array.wrap uniformly --- activemodel/lib/active_model/validator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activemodel/lib/active_model/validator.rb') diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index b61f0cb266..b7c52be3f0 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -1,3 +1,4 @@ +require 'active_support/core_ext/array/wrap' require "active_support/core_ext/module/anonymous" module ActiveModel #:nodoc: @@ -130,7 +131,7 @@ module ActiveModel #:nodoc: # +options+ reader, however the :attributes option will be removed # and instead be made available through the +attributes+ reader. def initialize(options) - @attributes = Array(options.delete(:attributes)) + @attributes = Array.wrap(options.delete(:attributes)) raise ":attributes cannot be blank" if @attributes.empty? super check_validity! -- cgit v1.2.3