Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix limit bug

  • Loading branch information...
commit f63de48633cf8a7d98fb0fac46fcedbb11a829a2 1 parent 196a0ad
@grobie authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 detector.rb
View
6 detector.rb
@@ -16,8 +16,8 @@ def self.output(results, key)
end
if Datenreinigung::Config["detector"]["save"] && !values.empty?
- query = 'INSERT INTO matches (kunde1_id,kunde2_id,`key`,distance) VALUES (' + values.join('),(') + ')'
- ActiveRecord::Base.connection.execute(query)
+ insert = Datenreinigung::Config["database"]["adapter"] == "mysql" ? "INSERT INTO matches (kunde1_id,kunde2_id,`key`,distance) VALUES" : "INSERT INTO matches (kunde1_id,kunde2_id,key,distance) VALUES"
+ ActiveRecord::Base.connection.execute("#{insert} (#{values.join('),(')} )")
end
end
@@ -30,7 +30,7 @@ def self.process
(0..steps).each do |step|
retrieve = Time.now
- kunden = Kunde.all(:conditions => "kunden_keys.keyname = '#{key}'", :joins => :key, :order => 'value ASC', :offset => [step*STEPSIZE - WINDOWSIZE, 0].max, :limit => (step+1)*STEPSIZE)
+ kunden = Kunde.all(:conditions => "kunden_keys.keyname = '#{key}'", :joins => :key, :order => 'value ASC', :offset => [step*STEPSIZE - WINDOWSIZE, 0].max, :limit => STEPSIZE)
next if kunden.empty?
Please sign in to comment.
Something went wrong with that request. Please try again.