JackDanger/permanent_records

Time for deleting dependent records

link-er opened this issue · 1 comments

Hello
I noticed that sometimes my object with dependent objects are not reviving properly, i.e. not every dependent object is reviving. In your code I found next statements:

     def revive_destroyed_dependent_records
       ....
        records = records.find(:all,
        :conditions => [
          "#{reflection.quoted_table_name}.deleted_at > ?" +
          " AND " +
          "#{reflection.quoted_table_name}.deleted_at < ?",
          deleted_at - 3.seconds,
          deleted_at + 3.seconds
        ]
      )
      ....
    end

Maybe sometimes not all the dependent records are destroyed in 6 seconds? Is there any possibility to override this time?

I know you opened this issue forever ago but this is a great idea. I just pushed a new version of the gem that lets you override the time constant via PermanentRecords.dependent_record_window = 10.seconds or whatever you need. Thanks for the great idea!