Sha256: 5a3ac780bdcbb6e364a4d15d7bbb423f6f086d29fce8bcfa708ed1b15af9b383
Contents?: true
Size: 1.03 KB
Versions: 54
Compression:
Stored size: 1.03 KB
Contents
# This migration comes from social_stream_base_engine (originally 20120403175913) class CreateActivityObjectAudiences < ActiveRecord::Migration def change create_table :activity_object_audiences do |t| t.references :activity_object t.references :relation t.timestamps end add_foreign_key :activity_object_audiences, :activity_objects, :name => 'activity_object_audiences_on_activity_object_id' add_foreign_key :activity_object_audiences, :relations, :name => 'activity_object_audiences_on_relation_id' ActivityObject.all.each do |ao| post_activity = ao.post_activity next if post_activity.blank? ao.relation_ids = post_activity.relation_ids end ActivityObjectAudience.record_timestamps = false ActivityObject.all.each do |ao| ao.activity_object_audiences.each do |aud| aud.created_at = aud.updated_at = ao.created_at aud.save! end end ActivityObjectAudience.record_timestamps = true ActivityObject.reset_column_information end end
Version data entries
54 entries across 54 versions & 2 rubygems