Reset memory of all DataOutputAgents for the last fix to take effect

Akinori MUSHA %!s(int64=8) %!d(string=hace) años
padre
commit
308f5ec888
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      db/migrate/20161007030910_reset_data_output_agents.rb

+ 9 - 0
db/migrate/20161007030910_reset_data_output_agents.rb

@@ -0,0 +1,9 @@
1
+class ResetDataOutputAgents < ActiveRecord::Migration
2
+  def up
3
+    Agents::DataOutputAgent.find_each do |agent|
4
+      agent.memory = {}
5
+      agent.save(validate: false)
6
+      agent.latest_events(true)
7
+    end
8
+  end
9
+end