lib/stratify/archiver.rb in stratify-base-0.1.3 vs lib/stratify/archiver.rb in stratify-base-0.1.4
- old
+ new
@@ -1,11 +1,11 @@
require 'stratify/logger'
module Stratify
class Archiver
attr_reader :collector
-
+
def initialize(collector)
@collector = collector
end
def run
@@ -26,20 +26,20 @@
def document_activity_source(activity)
activity.source = collector.source
end
def persist_activity(activity)
- # Since we run the collectors frequently, it is very common to encounter
+ # Since we run the collectors frequently, it is very common to encounter
# objects that we have already imported. If this activity is a duplicate
# of an existing object, then we skip importing this activity.
- return if activity.duplicate?
+ return if activity.duplicate?
unless activity.save
Stratify.logger.error("Failed to persist activity: #{activity}.\nValidation errors: #{activity.errors}")
end
end
-
+
def record_collection_statistics
collector.update_attribute :last_ran_at, Time.now
end
end
-end
\ No newline at end of file
+end