app/models/import.rb in reso-0.1.5.11 vs app/models/import.rb in reso-0.1.6
- old
+ new
@@ -1,7 +1,8 @@
class Import < ActiveRecord::Base
+ require "activerecord-import/base"
require 'nokogiri'
require 'open-uri'
require 'open_uri_redirections'
before_save :set_import_format
@@ -125,10 +126,11 @@
begin
doc.css(import.repeating_element).each do |o|
listing_data = {}
Hash.from_xml(o.to_xml)[import.repeating_element].each_pair{|key, value| listing_data[key] = value }
queued_listing = QueuedListing.new(import: import, listing_data: listing_data)
- queued_listing.save
+ QueuedListing.import Array(queued_listing), :validate => false
+# queued_listing.save
return Mapper::unique_identifier(queued_listing)
end
rescue Exception => e
puts e.inspect
exit if Rails.env.development?