BookingSync / synced

Keep your BookingSync Application synced with BookingSync
MIT License
3 stars 2 forks source link

transaction_per_page returns all processed objects #78

Closed thilonel closed 7 years ago

StoneFrog commented 7 years ago

@thilonel Why do we need this change? If I remember correctly, this was the main problem with auto_paginate - storing all records was eating too much memory in case of huge collections

thilonel commented 7 years ago

@StoneFrog ah that is also true... why I personally need this, is because my app does:

  def self.synchronize(*)
    super.tap do |collection|
      collection.each do |rates_rule|
StoneFrog commented 7 years ago

@thilonel Take a look at the hook handle_processed_objects_proc. You can pass proc and it'll execute operation on each batch

thilonel commented 7 years ago

Nice! I was too much in a rush, should've stopped to think first. Thank you!