20140823000002_update_activity_stream_object_lookup.rb 419 B

12345678910111213141516
  1. class UpdateActivityStreamObjectLookup < ActiveRecord::Migration
  2. def up
  3. ActivityStream.all.each {|entry|
  4. ao = ActivityStream::Object.find(entry.activity_stream_object_id)
  5. lookup_id = ObjectLookup.by_name( ao.name )
  6. entry.update_attribute( :activity_stream_object_id, lookup_id )
  7. entry.cache_delete
  8. }
  9. drop_table :activity_stream_objects
  10. Cache.clear
  11. end
  12. def down
  13. end
  14. end