lib/appstats/log_collector.rb in appstats-0.20.10 vs lib/appstats/log_collector.rb in appstats-0.20.11
- old
+ new
@@ -87,11 +87,11 @@
Appstats.log(:info, "Loaded #{count} file(s).")
count
end
def self.download_remote_files(raw_logins)
- all = LogCollector.where("status = 'unprocessed'").all
+ all = Appstats.rails3? ? LogCollector.where("status = 'unprocessed'").all : LogCollector.find(:all,:conditions => "status = 'unprocessed'")
if all.empty?
Appstats.log(:info,"No remote logs to download.")
return 0
end
@@ -125,11 +125,11 @@
Appstats.log(:info,"Downloaded #{count} file(s).")
count
end
def self.process_local_files
- all = LogCollector.where("status = 'downloaded'").all
+ all = Appstats.rails3? ? LogCollector.where("status = 'downloaded'").all : LogCollector.find(:all, :conditions => "status = 'downloaded'")
if all.empty?
Appstats.log(:info,"No local logs to process.")
return 0
end
Appstats.log(:info,"About to process #{all.size} file(s).")
@@ -157,10 +157,10 @@
Appstats.log(:info,"Processed #{count} file(s) with #{total_entries} entr(ies).")
count
end
def self.remove_remote_files(raw_logins)
- all = LogCollector.where("status = 'processed'").all
+ all = Appstats.rails3? ? LogCollector.where("status = 'processed'").all : LogCollector.find(:all,:conditions => "status = 'processed'")
if all.empty?
Appstats.log(:info,"No remote logs to remove.")
return 0
end
\ No newline at end of file