socialforge/db/migrate/20151013091057_update_princ...

16 lines
431 B
Ruby
Raw Normal View History

2015-10-14 11:38:16 +08:00
class UpdatePrincipalActivity < ActiveRecord::Migration
def up
User.all.each do |user|
transaction do
user.principal_acts << PrincipalActivity.new(:user_id => user.id,:principal_id => user.id)
user.journals_for_messages.each do |jour|
jour.principal_acts << PrincipalActivity.new(:user_id => jour.user_id,:principal_id => user.id)
end
end
end
end
def down
end
end