aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/validator.rb')
-rw-r--r--activemodel/lib/active_model/validator.rb3
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!