From 899af1e412352e26d0b6df034440b60b3a3530a7 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Tue, 16 Nov 2010 23:55:19 -0800 Subject: [PATCH] No reason to pull :validate out of the options hash, and it's obfuscatory - remove. --- lib/activerecord-import/import.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/activerecord-import/import.rb b/lib/activerecord-import/import.rb index 0417073..73f1ffd 100644 --- a/lib/activerecord-import/import.rb +++ b/lib/activerecord-import/import.rb @@ -188,8 +188,6 @@ class ActiveRecord::Base array_of_attributes.each { |a| a << nil } end - is_validating = options.delete( :validate ) - # dup the passed in array so we don't modify it unintentionally array_of_attributes = array_of_attributes.dup @@ -198,7 +196,7 @@ class ActiveRecord::Base add_special_rails_stamps column_names, array_of_attributes, options end - return_obj = if is_validating + return_obj = if options[:validate] import_with_validations( column_names, array_of_attributes, options ) else num_inserts = import_without_validations_or_callbacks( column_names, array_of_attributes, options )