Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 619 Bytes

working-on-chat.rst

File metadata and controls

20 lines (14 loc) · 619 Bytes

Working with chat logs

Removing IP Address Logs

Use the following command to remove all IP address records from closed chats that haven’t been updated in the last seven days:

>> Chat::Session.where(state: 'closed').where('updated_at < ?', 7.days.ago).each do |session|
     next if session.preferences['remote_ip'].blank?

     session.preferences.delete('geo_ip')
     session.preferences.delete('remote_ip')
     session.save!(touch: false)
   end