diff options
author | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-28 12:04:00 +0430 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-28 12:04:00 +0430 |
commit | b4c91de9462f59d6395c7c871aafa3301afdc383 (patch) | |
tree | fadcaf603a6f473e8ccd52070a1f3b4f957c34cb /activemodel/lib/active_model/validator.rb | |
parent | 4b4f69b9bfbd33556e23262f57cf6d944dfd9f63 (diff) | |
parent | 66d57d7ba83df52ff1e0485c89f6192c2f84c6b8 (diff) | |
download | rails-b4c91de9462f59d6395c7c871aafa3301afdc383.tar.gz rails-b4c91de9462f59d6395c7c871aafa3301afdc383.tar.bz2 rails-b4c91de9462f59d6395c7c871aafa3301afdc383.zip |
Merge remote branch 'rails/master'
Diffstat (limited to 'activemodel/lib/active_model/validator.rb')
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 <tt>:attributes</tt> 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! |