title: Rails how to run a method when a record is three months old?
body: <p>Basically what i want to do is to delete a file and a record (which contains the file path) when the record is three months old, the file is uploaded through Carrierwave.</p>
  
  <p>This is kinda what i have in mind for deleting the record and file.</p>
  
  <pre><code> # Code for deleteing PDF files (receipts) every 90 days
    def auto_delete_receipts
      #get user id from params or as a method parameter
      user = params[:id]
  
      user.receipts.each do |receipt|
        #check if receipt is three months old
          receipt.remove_receiptFile!
          receipt.save
        #end
      end
    end
  </code></pre>
  
  <p>so i would like to know where should i locate my method and how to automatically run it everytime a record gets three months old, in order to delete it.</p>
  
  <p>Thanks for reading.</p>