HabitatMap/AirCasting

View on GitHub
lib/tasks/sync_measurements_counter.rake

Summary

Maintainability
Test Coverage
desc "Sync measurements count on streams"
task :sync_measurements_counter => [:environment] do
  Stream.find_in_batches do |streams|
      streams.each do |stream|
        Stream.reset_counters(stream.id, :measurements)
    end
  end
end