From af0582968dfb400375bbef6ace7166aac1041f3d Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 31 Oct 2012 00:20:50 -0200 Subject: Remove prepend_and_append requirement from AS It's not necessary to use this extension here, we are fine with Array#unshift. --- activerecord/lib/active_record/validations/uniqueness.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index 31dbf7a889..5db17155c5 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/array/prepend_and_append' - module ActiveRecord module Validations class UniquenessValidator < ActiveModel::EachValidator # :nodoc: @@ -53,7 +51,7 @@ module ActiveRecord class_hierarchy = [record.class] while class_hierarchy.first != @klass - class_hierarchy.prepend(class_hierarchy.first.superclass) + class_hierarchy.unshift(class_hierarchy.first.superclass) end class_hierarchy.detect { |klass| !klass.abstract_class? } -- cgit v1.2.3