diff --git a/app/models/api_namespace.rb b/app/models/api_namespace.rb index 5f1bc94cb..7a9487dba 100755 --- a/app/models/api_namespace.rb +++ b/app/models/api_namespace.rb @@ -146,7 +146,7 @@ def redirect_actions(trigger) end def rerun_api_actions - executed_api_actions.where(lifecycle_stage: 'failed').each(&:execute_action) + executed_api_actions.where(lifecycle_stage: 'failed').find_each(&:execute_action) end def discard_failed_actions diff --git a/app/models/subdomain.rb b/app/models/subdomain.rb index 74690fe8e..db0b9dc02 100755 --- a/app/models/subdomain.rb +++ b/app/models/subdomain.rb @@ -235,8 +235,8 @@ def change_2fa_setting def purge_stored_files Apartment::Tenant.switch(self.name) do - ActiveStorage::Attachment.all.each { |attachment| attachment.purge } - ActiveStorage::Blob.all.each { |blob| blob.purge } + ActiveStorage::Attachment.find_each { |attachment| attachment.purge } + ActiveStorage::Blob.find_each { |blob| blob.purge } end end