Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Error caused by modifying arguments

#12

When passing the same array of column names into import for the list of column names, and for the list of on_duplicate_key_update option, the list is modified in places and causes sql queries with improper columns. Here is a rough patch

--- a/vendor/plugins/ar-extensions/lib/ar-extensions/import.rb
+++ b/vendor/plugins/ar-extensions/lib/ar-extensions/import.rb
@@ -175,7 +175,7 @@ class ActiveRecord::Base
         end
         # supports 2-element array and array
       elsif args.size == 2 and args.first.is_a?( Array ) and args.last.is_a?( Array )
-        column_names, array_of_attributes = args
+        column_names, array_of_attributes = args.first.dup, args.last.dup
       else
         raise ArgumentError.new( "Invalid arguments!" )
       end

Reported by Mark Van Holstyn · November 26th, 2008 @ 08:39 PM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.